Change: Add extra padding to climate buttons to match pre-#11464. (#11525)

Padding used to be included in the SetMinimalSize() part which was removed, but also made it require specific sprite sizes.

This now adds padding on the already determined size, removing the need for hardcoding pixel dimensions and allowing the sprites to be any size.
This commit is contained in:
Peter Nelson
2023-11-30 19:18:28 +00:00
committed by GitHub
parent 6f7153bf71
commit 4a5ab331e2
2 changed files with 23 additions and 0 deletions

View File

@@ -297,6 +297,17 @@ struct SelectGameWindow : public Window {
}
}
void UpdateWidgetSize(int widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override
{
switch (widget) {
case WID_SGI_TEMPERATE_LANDSCAPE: case WID_SGI_ARCTIC_LANDSCAPE:
case WID_SGI_TROPIC_LANDSCAPE: case WID_SGI_TOYLAND_LANDSCAPE:
size->width += WidgetDimensions::scaled.fullbevel.Horizontal();
size->height += WidgetDimensions::scaled.fullbevel.Vertical();
break;
}
}
void OnResize() override
{
bool changed = false;