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:
2025-06-08 19:13:47 +01:00
committed by GitHub
parent 7c9c2aec49
commit de660cba02
10 changed files with 157 additions and 130 deletions

View File

@@ -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.