Codechange: Use window parent association for dropdowns.
This replaces the separate window class and number properties, and allows the window system to close dropdowns automatically.
This commit is contained in:
@@ -363,7 +363,7 @@ struct NewGRFParametersWindow : public Window {
|
||||
uint num = it - this->grf_config->param_info.begin();
|
||||
if (this->clicked_row != num) {
|
||||
this->CloseChildWindows(WC_QUERY_STRING);
|
||||
HideDropDownMenu(this);
|
||||
this->CloseChildWindows(WC_DROPDOWN_MENU);
|
||||
this->clicked_row = num;
|
||||
this->clicked_dropdown = false;
|
||||
}
|
||||
@@ -379,7 +379,7 @@ struct NewGRFParametersWindow : public Window {
|
||||
if (par_info.type != PTYPE_BOOL && IsInsideMM(x, 0, SETTING_BUTTON_WIDTH) && par_info.complete_labels) {
|
||||
if (this->clicked_dropdown) {
|
||||
/* unclick the dropdown */
|
||||
HideDropDownMenu(this);
|
||||
this->CloseChildWindows(WC_DROPDOWN_MENU);
|
||||
this->clicked_dropdown = false;
|
||||
this->closing_dropdown = false;
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user