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:
@@ -276,7 +276,7 @@ struct GSConfigWindow : public Window {
|
||||
int num = it - this->visible_settings.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;
|
||||
}
|
||||
@@ -292,7 +292,7 @@ struct GSConfigWindow : public Window {
|
||||
if (!bool_item && IsInsideMM(x, 0, SETTING_BUTTON_WIDTH) && config_item.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 {
|
||||
@@ -408,7 +408,7 @@ struct GSConfigWindow : public Window {
|
||||
this->SetWidgetDisabledState(WID_GSC_TEXTFILE + tft, !GameConfig::GetConfig()->GetTextfile(tft, (CompanyID)OWNER_DEITY).has_value());
|
||||
}
|
||||
this->RebuildVisibleSettings();
|
||||
HideDropDownMenu(this);
|
||||
this->CloseChildWindows(WC_DROPDOWN_MENU);
|
||||
this->CloseChildWindows(WC_QUERY_STRING);
|
||||
}
|
||||
private:
|
||||
|
Reference in New Issue
Block a user