changeset 8326:d2557922bc07 draft

(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.
author peter1138 <peter1138@openttd.org>
date Thu, 17 Jan 2008 13:37:28 +0000
parents 5f33f93ed180
children b5058eea06a1
files src/group_gui.cpp
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/group_gui.cpp
+++ b/src/group_gui.cpp
@@ -305,7 +305,7 @@
 		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 @@
 		}
 
 		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;