forked from mirror/OpenTTD
Change: Consistent toolbar sizes with dedicated NWidgetParts. (#14344)
Add SetToolbarSpacerMinimalSize() and SetToolbarMinimalSize() NWidgetParts and use to make toolbar button sizes consistent.
This commit is contained in:
@@ -1149,6 +1149,25 @@ constexpr NWidgetPart SetMinimalSize(int16_t x, int16_t y)
|
||||
return NWidgetPart{WPT_MINSIZE, Point{x, y}};
|
||||
}
|
||||
|
||||
/**
|
||||
* Widget part function to setting the minimal size for a toolbar spacer.
|
||||
* @ingroup NestedWidgetParts
|
||||
*/
|
||||
constexpr NWidgetPart SetToolbarSpacerMinimalSize()
|
||||
{
|
||||
return NWidgetPart{WPT_MINSIZE, Point{4, 0}};
|
||||
}
|
||||
|
||||
/**
|
||||
* Widget part function to setting the minimal size for a toolbar button.
|
||||
* @param width Width of button, measured in multiples of the standard toolbar button size.
|
||||
* @ingroup NestedWidgetParts
|
||||
*/
|
||||
constexpr NWidgetPart SetToolbarMinimalSize(int width)
|
||||
{
|
||||
return NWidgetPart{WPT_MINSIZE, Point{20 * width + 2, 22}};
|
||||
}
|
||||
|
||||
/**
|
||||
* Widget part function for setting the minimal text lines.
|
||||
* @param lines Number of text lines.
|
||||
|
Reference in New Issue
Block a user