summaryrefslogtreecommitdiff
path: root/src/group_gui.cpp
diff options
context:
space:
mode:
authorplanetmaker <planetmaker@openttd.org>2010-10-19 21:48:20 +0000
committerplanetmaker <planetmaker@openttd.org>2010-10-19 21:48:20 +0000
commitc2a7b82a9f58511638883fedca21dad1e5bf4ab9 (patch)
tree06a38b71e21fb1d3dce1322cf15f39c25d1f6fe8 /src/group_gui.cpp
parent9373ee71d999a08c51938f6214fc0360c477992a (diff)
downloadopenttd-c2a7b82a9f58511638883fedca21dad1e5bf4ab9.tar.xz
(svn r20997) -Fix: Size of sort buttons for order and vehicle list gui could be too small
Diffstat (limited to 'src/group_gui.cpp')
-rw-r--r--src/group_gui.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/group_gui.cpp b/src/group_gui.cpp
index bae682c9e..62401cac4 100644
--- a/src/group_gui.cpp
+++ b/src/group_gui.cpp
@@ -231,6 +231,14 @@ public:
size->width += WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT + 8 + 8;
break;
+ case GRP_WIDGET_SORT_BY_ORDER: {
+ Dimension d = GetStringBoundingBox(this->GetWidget<NWidgetCore>(widget)->widget_data);
+ d.width += padding.width + WD_SORTBUTTON_ARROW_WIDTH * 2; // Doubled since the string is centred and it also looks better.
+ d.height += padding.height;
+ *size = maxdim(*size, d);
+ break;
+ }
+
case GRP_WIDGET_LIST_VEHICLE:
resize->height = GetVehicleListHeight(this->vli.vtype, FONT_HEIGHT_NORMAL + WD_MATRIX_TOP);
size->height = 4 * resize->height;