gui1: Add border case for gui::dialog::BUTTON_TOP

When there's only one button with this hint, and there's a textbox, try
to align the button to the textbox. This makes the Filter/View Mode row
in the Add-ons Manager dialog look tidier.
This commit is contained in:
Ignacio R. Morelle 2012-05-26 05:09:42 +00:00
parent f8e9e64c18
commit d25365eb0e

View File

@ -637,7 +637,13 @@ dialog::dimension_measurements dialog::layout(int xloc, int yloc)
std::pair<int, int> coords(0, 0);
coords.first = dim.x + total_width - btn.width() - ButtonHPadding;
coords.second = top_buttons_y;
// As a special case, if there's only one button
// and a text box, try to align the button to it
if(top_buttons_.size() == 1 && use_textbox) {
coords.second = text_widget_y + (text_widget_height - btn.height())/2;
} else {
coords.second = top_buttons_y;
}
top_buttons_y += btn.height() + button_height_padding;