mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Close dropdowns by class instead of id.
parent
81e5cd23e0
commit
53709f0bdc
|
@ -353,7 +353,7 @@ struct DropdownWindow : Window {
|
||||||
*/
|
*/
|
||||||
void ShowDropDownListAt(Window *w, DropDownList &&list, int selected, int button, Rect wi_rect, Colours wi_colour, bool auto_width, bool instant_close)
|
void ShowDropDownListAt(Window *w, DropDownList &&list, int selected, int button, Rect wi_rect, Colours wi_colour, bool auto_width, bool instant_close)
|
||||||
{
|
{
|
||||||
CloseWindowById(WC_DROPDOWN_MENU, 0);
|
CloseWindowByClass(WC_DROPDOWN_MENU);
|
||||||
|
|
||||||
/* The preferred position is just below the dropdown calling widget */
|
/* The preferred position is just below the dropdown calling widget */
|
||||||
int top = w->top + wi_rect.bottom + 1;
|
int top = w->top + wi_rect.bottom + 1;
|
||||||
|
|
|
@ -3489,7 +3489,7 @@ void ChangeVehicleViewports(VehicleID from_index, VehicleID to_index)
|
||||||
*/
|
*/
|
||||||
void RelocateAllWindows(int neww, int newh)
|
void RelocateAllWindows(int neww, int newh)
|
||||||
{
|
{
|
||||||
CloseWindowById(WC_DROPDOWN_MENU, 0);
|
CloseWindowByClass(WC_DROPDOWN_MENU);
|
||||||
|
|
||||||
for (Window *w : Window::Iterate()) {
|
for (Window *w : Window::Iterate()) {
|
||||||
int left, top;
|
int left, top;
|
||||||
|
|
Loading…
Reference in New Issue