summaryrefslogtreecommitdiff
path: root/src/group_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-11-15 19:18:52 +0000
committerrubidium <rubidium@openttd.org>2007-11-15 19:18:52 +0000
commit72a59fade23a9a8971348179d652d468694e2159 (patch)
treed9357ed2c3ba5c00f6081e8bc9a2aadcad81e858 /src/group_gui.cpp
parentecdb16de42874125991b1e770616e46e9c4d24bb (diff)
downloadopenttd-72a59fade23a9a8971348179d652d468694e2159.tar.xz
(svn r11441) -Fix [FS#1443]: manage list dropdown menu did not "disappear" when the all vehicles are removed from the "current" group.
Diffstat (limited to 'src/group_gui.cpp')
-rw-r--r--src/group_gui.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/group_gui.cpp b/src/group_gui.cpp
index efcb0eb63..1ecb8172b 100644
--- a/src/group_gui.cpp
+++ b/src/group_gui.cpp
@@ -328,6 +328,19 @@ static void GroupWndProc(Window *w, WindowEvent *e)
SetVScrollCount(w, gl->l.list_length);
SetVScroll2Count(w, gv->l.list_length);
+ /* The drop down menu is out, *but* it may not be used, retract it. */
+ if (gv->l.list_length == 0 && IsWindowWidgetLowered(w, GRP_WIDGET_MANAGE_VEHICLES_DROPDOWN)) {
+ RaiseWindowWidget(w, GRP_WIDGET_MANAGE_VEHICLES_DROPDOWN);
+ Window **w2;
+ FOR_ALL_WINDOWS(w2) {
+ if (w->window_class == WP(*w2, dropdown_d).parent_wnd_class &&
+ w->window_number == WP(*w2, dropdown_d).parent_wnd_num) {
+ DeleteWindow(*w2);
+ break;
+ }
+ }
+ }
+
/* Disable all lists management button when the list is empty */
SetWindowWidgetsDisabledState(w, gv->l.list_length == 0 || _local_player != owner,
GRP_WIDGET_STOP_ALL,