summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2008-01-17 13:37:28 +0000
committerpeter1138 <peter1138@openttd.org>2008-01-17 13:37:28 +0000
commitf788298209ddd4dd7a1cc093ef73b89d25b84688 (patch)
tree71f0d7b8e6a3b02188eadcb1427ea9957b4fc0e0
parentf5d72cc84c36e4879969a023f8e01f62b316de6f (diff)
downloadopenttd-f788298209ddd4dd7a1cc093ef73b89d25b84688.tar.xz
(svn r11892) -Fix (r11879): View switched from ungrouped to all vehicles as ungrouped is not technically a valid group, and ensure dropdown is removed
on any click in the window.
-rw-r--r--src/group_gui.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/group_gui.cpp b/src/group_gui.cpp
index b66d0c138..14c337042 100644
--- a/src/group_gui.cpp
+++ b/src/group_gui.cpp
@@ -305,7 +305,7 @@ static void GroupWndProc(Window *w, WindowEvent *e)
case WE_INVALIDATE_DATA:
gv->l.flags |= VL_REBUILD;
gl->l.flags |= VL_REBUILD;
- if (!IsValidGroupID(gv->group_sel)) {
+ if (!(IsAllGroupID(gv->group_sel) || IsDefaultGroupID(gv->group_sel) || IsValidGroupID(gv->group_sel))) {
gv->group_sel = ALL_GROUP;
HideDropDownMenu(w);
}
@@ -503,6 +503,8 @@ static void GroupWndProc(Window *w, WindowEvent *e)
}
case WE_CLICK:
+ HideDropDownMenu(w);
+
switch(e->we.click.widget) {
case GRP_WIDGET_SORT_BY_ORDER: // Flip sorting method ascending/descending
gv->l.flags ^= VL_DESC;