mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-18 09:52:44 +01:00
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:
@@ -311,7 +311,7 @@ class BuildIndustryWindow : public Window {
|
||||
bool enabled; ///< Availability state of the selected industry.
|
||||
Scrollbar *vscroll;
|
||||
Dimension legend; ///< Dimension of the legend 'blob'.
|
||||
GUIBadgeClasses badge_classes{GSF_INDUSTRIES};
|
||||
GUIBadgeClasses badge_classes;
|
||||
|
||||
/** The largest allowed minimum-width of the window, given in line heights */
|
||||
static const int MAX_MINWIDTH_LINEHEIGHTS = 20;
|
||||
@@ -419,6 +419,8 @@ public:
|
||||
|
||||
void OnInit() override
|
||||
{
|
||||
this->badge_classes = GUIBadgeClasses{GSF_INDUSTRIES};
|
||||
|
||||
/* Width of the legend blob -- slightly larger than the smallmap legend blob. */
|
||||
this->legend.height = GetCharacterHeight(FS_SMALL);
|
||||
this->legend.width = this->legend.height * 9 / 6;
|
||||
|
||||
Reference in New Issue
Block a user