From 53709f0bdc3965ee4a93b2cc04e61afba56738cc Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sat, 3 Jun 2023 13:21:08 +0100 Subject: [PATCH] Codechange: Close dropdowns by class instead of id. --- src/widgets/dropdown.cpp | 2 +- src/window.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/widgets/dropdown.cpp b/src/widgets/dropdown.cpp index c7f57edc4b..1d25211b1b 100644 --- a/src/widgets/dropdown.cpp +++ b/src/widgets/dropdown.cpp @@ -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) { - CloseWindowById(WC_DROPDOWN_MENU, 0); + CloseWindowByClass(WC_DROPDOWN_MENU); /* The preferred position is just below the dropdown calling widget */ int top = w->top + wi_rect.bottom + 1; diff --git a/src/window.cpp b/src/window.cpp index 5ded380e81..e7f5f4f78e 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -3489,7 +3489,7 @@ void ChangeVehicleViewports(VehicleID from_index, VehicleID to_index) */ void RelocateAllWindows(int neww, int newh) { - CloseWindowById(WC_DROPDOWN_MENU, 0); + CloseWindowByClass(WC_DROPDOWN_MENU); for (Window *w : Window::Iterate()) { int left, top;