summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-11-08 09:58:37 +0000
committerfrosch <frosch@openttd.org>2012-11-08 09:58:37 +0000
commitc27a026d173d2dd612792bf613521597ee067015 (patch)
tree3b9fd5ec85c42efb06b1625ab013ec938cc3e4d2
parent3e367cd0875b036e51789fb77cfbc9a4af06714f (diff)
downloadopenttd-c27a026d173d2dd612792bf613521597ee067015.tar.xz
(svn r24669) -Fix: Auto-expand advanced settings only when selecting a 'deviation' filter.
-rw-r--r--src/settings_gui.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp
index c64d00619..e706abdd1 100644
--- a/src/settings_gui.cpp
+++ b/src/settings_gui.cpp
@@ -2331,8 +2331,15 @@ struct GameSettingsWindow : QueryStringBaseWindow {
{
if (widget == WID_GS_RESTRICT_DROPDOWN) {
this->cur_restriction_mode = (RestrictionMode)index;
- _settings_main_page.UpdateFilterState(string_filter, false, this->cur_restriction_mode);
- this->SetDirty();
+ if (!this->manually_changed_folding &&
+ (this->cur_restriction_mode == RM_CHANGED_AGAINST_DEFAULT ||
+ this->cur_restriction_mode == RM_CHANGED_AGAINST_DEFAULT_WO_LOCAL ||
+ this->cur_restriction_mode == RM_CHANGED_AGAINST_NEW)) {
+ /* Expand all when selecting 'changes'. Update the filter state first, in case it becomes less restrictive in some cases. */
+ _settings_main_page.UpdateFilterState(string_filter, false, this->cur_restriction_mode);
+ _settings_main_page.UnFoldAll();
+ }
+ this->InvalidateData();
return;
}
@@ -2358,10 +2365,6 @@ struct GameSettingsWindow : QueryStringBaseWindow {
* "normal" dropdown box. The special dropdown boxes added for every
* setting that needs one can't have this call. */
Window::OnDropdownClose(pt, widget, index, instant_close);
-
- if (!this->manually_changed_folding) _settings_main_page.UnFoldAll();
-
- this->InvalidateData();
return;
}