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:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user