summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/vehicle_gui.cpp38
1 files changed, 24 insertions, 14 deletions
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp
index a01d75dba..3d1e20c71 100644
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -1087,23 +1087,33 @@ public:
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
{
- if (widget != VLW_WIDGET_LIST) return;
-
- resize->width = 0;
- resize->height = GetVehicleListHeight(this->vehicle_type, 1);
+ switch (widget) {
+ case VLW_WIDGET_LIST:
+ resize->width = 0;
+ resize->height = GetVehicleListHeight(this->vehicle_type, 1);
- switch (this->vehicle_type) {
- case VEH_TRAIN:
- resize->width = 1;
- /* Fallthrough */
- case VEH_ROAD:
- size->height = 6 * resize->height;
+ switch (this->vehicle_type) {
+ case VEH_TRAIN:
+ resize->width = 1;
+ /* Fallthrough */
+ case VEH_ROAD:
+ size->height = 6 * resize->height;
+ break;
+ case VEH_SHIP:
+ case VEH_AIRCRAFT:
+ size->height = 4 * resize->height;
+ break;
+ default: NOT_REACHED();
+ }
break;
- case VEH_SHIP:
- case VEH_AIRCRAFT:
- size->height = 4 * resize->height;
+
+ case VLW_WIDGET_MANAGE_VEHICLES_DROPDOWN: {
+ Dimension d = this->GetActionDropdownSize((this->window_number & VLW_MASK) == VLW_STANDARD, false);
+ d.height += padding.height;
+ d.width += padding.width;
+ *size = maxdim(*size, d);
break;
- default: NOT_REACHED();
+ }
}
}