Cleanup: Call SetMinimalSize instead of setting min_y directly.

This commit is contained in:
Peter Nelson
2021-04-08 09:02:38 +01:00
committed by PeterN
parent f5569763c9
commit 03a43b8247
2 changed files with 9 additions and 8 deletions

View File

@@ -2268,7 +2268,8 @@ NWidgetLeaf::NWidgetLeaf(WidgetType tp, Colours colour, int index, uint32 data,
case WWT_CAPTION:
this->SetFill(1, 0);
this->SetResize(1, 0);
this->min_y = WD_CAPTION_HEIGHT;
this->SetMinimalSize(0, WD_CAPTION_HEIGHT);
this->SetMinimalTextLines(1, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM, FS_NORMAL);
this->SetDataTip(data, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS);
break;
@@ -2310,7 +2311,7 @@ NWidgetLeaf::NWidgetLeaf(WidgetType tp, Colours colour, int index, uint32 data,
case WWT_DROPDOWN:
this->SetFill(0, 0);
this->min_y = WD_DROPDOWN_HEIGHT;
this->SetMinimalSize(0, WD_DROPDOWN_HEIGHT);
this->SetAlignment(SA_TOP | SA_LEFT);
break;