mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-11 16:54:42 +00:00
Fix: Make livery window resize properly if GUI scale changes whilst open.
This commit is contained in:
parent
011257dc88
commit
c9d801a98d
@ -700,9 +700,6 @@ public:
|
|||||||
this->CreateNestedTree();
|
this->CreateNestedTree();
|
||||||
this->vscroll = this->GetScrollbar(WID_SCL_MATRIX_SCROLLBAR);
|
this->vscroll = this->GetScrollbar(WID_SCL_MATRIX_SCROLLBAR);
|
||||||
|
|
||||||
this->square = GetSpriteSize(SPR_SQUARE);
|
|
||||||
this->line_height = max(this->square.height, (uint)FONT_HEIGHT_NORMAL) + 4;
|
|
||||||
|
|
||||||
if (group == INVALID_GROUP) {
|
if (group == INVALID_GROUP) {
|
||||||
this->livery_class = LC_OTHER;
|
this->livery_class = LC_OTHER;
|
||||||
this->sel = 1;
|
this->sel = 1;
|
||||||
@ -770,6 +767,9 @@ public:
|
|||||||
|
|
||||||
case WID_SCL_MATRIX: {
|
case WID_SCL_MATRIX: {
|
||||||
/* 11 items in the default rail class */
|
/* 11 items in the default rail class */
|
||||||
|
this->square = GetSpriteSize(SPR_SQUARE);
|
||||||
|
this->line_height = max(this->square.height, (uint)FONT_HEIGHT_NORMAL) + 4;
|
||||||
|
|
||||||
size->height = 11 * this->line_height;
|
size->height = 11 * this->line_height;
|
||||||
resize->width = 1;
|
resize->width = 1;
|
||||||
resize->height = this->line_height;
|
resize->height = this->line_height;
|
||||||
@ -784,6 +784,7 @@ public:
|
|||||||
FALLTHROUGH;
|
FALLTHROUGH;
|
||||||
|
|
||||||
case WID_SCL_PRI_COL_DROPDOWN: {
|
case WID_SCL_PRI_COL_DROPDOWN: {
|
||||||
|
this->square = GetSpriteSize(SPR_SQUARE);
|
||||||
int padding = this->square.width + NWidgetScrollbar::GetVerticalDimension().width + 10;
|
int padding = this->square.width + NWidgetScrollbar::GetVerticalDimension().width + 10;
|
||||||
for (const StringID *id = _colour_dropdown; id != endof(_colour_dropdown); id++) {
|
for (const StringID *id = _colour_dropdown; id != endof(_colour_dropdown); id++) {
|
||||||
size->width = max(size->width, GetStringBoundingBox(*id).width + padding);
|
size->width = max(size->width, GetStringBoundingBox(*id).width + padding);
|
||||||
|
Loading…
Reference in New Issue
Block a user