Departure boards: Fix excessive window width when using GUI zoom

This commit is contained in:
Jonathan G Rennison
2022-01-04 00:53:09 +00:00
parent 55b7e2178a
commit de41a54f94

View File

@@ -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<NWidgetCore>(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;