From de41a54f94e75d958d56186861d03b90f820b19c Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Tue, 4 Jan 2022 00:53:09 +0000 Subject: [PATCH] Departure boards: Fix excessive window width when using GUI zoom --- src/departures_gui.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/departures_gui.cpp b/src/departures_gui.cpp index 14ed6f834e..3704f1a6be 100644 --- a/src/departures_gui.cpp +++ b/src/departures_gui.cpp @@ -32,6 +32,7 @@ #include "company_type.h" #include "departures_func.h" #include "cargotype.h" +#include "zoom_func.h" #include "table/sprites.h" #include "table/strings.h" @@ -280,6 +281,7 @@ public: case WID_DB_LIST: resize->height = DeparturesWindow::entry_height; size->height = 2 * resize->height; + size->width = this->min_width; break; } } @@ -475,10 +477,8 @@ public: uint new_width = this->GetMinWidth(); if (new_width != this->min_width) { - NWidgetCore *n = this->GetWidget(WID_DB_LIST); - n->SetMinimalSize(new_width, 0); - this->ReInit(); this->min_width = new_width; + this->ReInit(); } uint new_height = 1 + FONT_HEIGHT_NORMAL + 1 + (_settings_client.gui.departure_larger_font ? FONT_HEIGHT_NORMAL : FONT_HEIGHT_SMALL) + 1 + 1;