From ca7dd193d485b603ea49086a99f588f95ec9b3b3 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Mon, 3 May 2021 00:28:38 +0100 Subject: [PATCH] Fix #253: Right column width in station window group/sort with large font --- src/station_gui.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/station_gui.cpp b/src/station_gui.cpp index b8dc3fbb45..07163886cb 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -1419,6 +1419,19 @@ struct StationViewWindow : public Window { fill->width = 0; } break; + + case WID_SV_GROUP_BY: + case WID_SV_SORT_BY: { + uint width = 0; + for (const StringID *str = _group_names; *str != INVALID_STRING_ID; str++) { + width = std::max(width, GetStringBoundingBox(*str).width); + } + for (const StringID *str = _sort_names; *str != INVALID_STRING_ID; str++) { + width = std::max(width, GetStringBoundingBox(*str).width); + } + size->width = width + padding.width; + break; + } } }