Fix 8f14894024: Badge widths were not updated on interface scale change. (#13630)

Prepare GUI badge class lists in OnInit() method of Windows, so that they handle scaling changes.
This commit is contained in:
Peter Nelson
2025-02-22 13:29:52 +00:00
committed by GitHub
parent 8566030c53
commit bb4ac915ff
5 changed files with 17 additions and 12 deletions

View File

@@ -1167,11 +1167,6 @@ struct BuildVehicleWindow : Window {
}
}
void BuildBadgeClasses()
{
this->badge_classes = GUIBadgeClasses(static_cast<GrfSpecFeature>(GSF_TRAINS + this->vehicle_type));
}
BuildVehicleWindow(WindowDesc &desc, TileIndex tile, VehicleType type) : Window(desc), vehicle_editbox(MAX_LENGTH_VEHICLE_NAME_CHARS * MAX_CHAR_LENGTH, MAX_LENGTH_VEHICLE_NAME_CHARS)
{
this->vehicle_type = type;
@@ -1184,8 +1179,6 @@ struct BuildVehicleWindow : Window {
this->descending_sort_order = _engine_sort_last_order[type];
this->show_hidden_engines = _engine_sort_show_hidden_engines[type];
this->BuildBadgeClasses();
this->UpdateFilterByTile();
this->CreateNestedTree();
@@ -1315,6 +1308,7 @@ struct BuildVehicleWindow : Window {
void OnInit() override
{
this->badge_classes = GUIBadgeClasses(static_cast<GrfSpecFeature>(GSF_TRAINS + this->vehicle_type));
this->SetCargoFilterArray();
}