Esempio n. 1
0
Pt StateButtonRepresenter::MinUsableSize(const StateButton& button) const
{
    Pt bn_ul, bn_lr, tx_ul;

    DoLayout(button, bn_ul, bn_lr, tx_ul);

    Pt text_lr = tx_ul + button.GetLabel()->MinUsableSize();
    return Pt(std::max(bn_lr.x, text_lr.x) - std::min(bn_ul.x, tx_ul.x),
              std::max(bn_lr.y, text_lr.y) - std::min(bn_ul.y, tx_ul.y));
}
Esempio n. 2
0
////////////////////////////////////////////////
// GG::BeveledTabRepresenter
////////////////////////////////////////////////
void BeveledTabRepresenter::Render(const StateButton& button) const
{
    const int BEVEL = 2;

    // draw button
    Pt cl_ul = button.ClientUpperLeft();
    Pt cl_lr = button.ClientLowerRight();
    Pt tx_ul = Pt();

    Clr color_to_use = button.Checked() ? button.Color() : DarkColor(button.Color());
    color_to_use = button.Disabled() ? DisabledColor(color_to_use) : color_to_use;
    if (!button.Checked()) {
        cl_ul.y += BEVEL;
        tx_ul.y = Y(BEVEL / 2);
    }
    BeveledRectangle(cl_ul, cl_lr,
                     color_to_use, color_to_use,
                     true, BEVEL,
                     true, true, true, !button.Checked());

    button.GetLabel()->OffsetMove(tx_ul);
    button.GetLabel()->Render();
    button.GetLabel()->OffsetMove(-(tx_ul));
}
Esempio n. 3
0
Pt BeveledTabRepresenter::MinUsableSize(const StateButton& button) const
{ return button.GetLabel()->MinUsableSize(); }