mirror of https://github.com/OpenTTD/OpenTTD
Change: Restore wider spacers in main toolbars. (#12039)
Width for all spacers was included only due to an off-by-one from counting buttons and not excluding the normally hidden switcher button. Spacer width of quarter the button width is now included explicitly,pull/13581/head
parent
70c9f3963c
commit
3ade64954c
|
@ -1414,7 +1414,13 @@ public:
|
||||||
child_wid->current_x = child_wid->smallest_x;
|
child_wid->current_x = child_wid->smallest_x;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_toolbar_width = nbuttons * this->smallest_x;
|
|
||||||
|
/* Exclude the switcher button which is not displayed when the toolbar fits the screen. When the switch is
|
||||||
|
* displayed there will be no spacers anyway. */
|
||||||
|
--nbuttons;
|
||||||
|
|
||||||
|
/* Allow space for all buttons, and include spacers at quarter the width of buttons. */
|
||||||
|
_toolbar_width = nbuttons * this->smallest_x + this->spacers * this->smallest_x / 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AssignSizePosition(SizingType sizing, int x, int y, uint given_width, uint given_height, bool rtl) override
|
void AssignSizePosition(SizingType sizing, int x, int y, uint given_width, uint given_height, bool rtl) override
|
||||||
|
|
Loading…
Reference in New Issue