@@ -1078,13 +1078,19 @@ NEWS_SETTINGS_LINE(28, NT_ACCEPTANCE),
NEWS_SETTINGS_LINE(28, NT_SUBSIDIES),
NEWS_SETTINGS_LINE(28, NT_GENERAL),
{ WIDGETS_END},
};
static NWidgetBase *MakeNewsSettingLines()
/**
* Make nested widget tree for the news settings.
* @param biggest_index Storage for collecting the biggest index used in the returned tree.
* @return Panel with rows of news settings.
* @postcond \c *biggest_index contains the largest used index in the tree.
*/
static NWidgetBase *MakeNewsSettingLines(int *biggest_index)
{
const int NEWS_SETTING_HEIGHT = 12; // Height of one line.
NWidgetVertical *vert = new NWidgetVertical;
int widnum = WIDGET_NEWSOPT_START_OPTION;
for (int i = 0; i < NT_END; i++) {
@@ -1107,12 +1113,13 @@ static NWidgetBase *MakeNewsSettingLines
leaf->SetMinimalSize(307, NEWS_SETTING_HEIGHT);
leaf->SetPadding(0, 0, 0, 4);
hor->Add(leaf);
vert->Add(hor);
}
*biggest_index = widnum - 1;
return vert;
static const NWidgetPart _nested_message_options_widgets[] = {
NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN, WIDGET_NEWSOPT_CLOSEBOX),