Change: Improve news window layouts.

* Use appropriate container widget nesting with padding, instead of single-sided padding.
* Use layer widget to allow main news message to overlay close box and date widgets, to more closely match the old fixed-pixel layout.
This commit is contained in:
2024-11-30 00:07:11 +00:00
committed by Peter Nelson
parent 60f1618cc7
commit 910dd65710
2 changed files with 113 additions and 43 deletions

View File

@@ -1230,6 +1230,17 @@ constexpr NWidgetPart SetPadding(uint8_t top, uint8_t right, uint8_t bottom, uin
return NWidgetPart{WPT_PADDING, NWidgetPartPaddings{left, top, right, bottom}};
}
/**
* Widget part function for setting additional space around a widget.
* @param horizontal The padding on either side of the widget.
* @param vertical The padding above and below the widget.
* @ingroup NestedWidgetParts
*/
constexpr NWidgetPart SetPadding(uint8_t horizontal, uint8_t vertical)
{
return NWidgetPart{WPT_PADDING, NWidgetPartPaddings{horizontal, vertical, horizontal, vertical}};
}
/**
* Widget part function for setting additional space around a widget.
* @param r The padding around the widget.