mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-21 14:34:53 +00:00
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:
parent
f8e9e64c18
commit
d25365eb0e
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user