1
0
Fork 0

Codechange: Disable clang-format for widget layouts.

pull/14014/head
frosch 2025-04-19 21:54:22 +02:00
parent 945579756c
commit 2480c14d49
61 changed files with 310 additions and 0 deletions

View File

@ -28,6 +28,7 @@
/** Widgets for the configure AI window. */ /** Widgets for the configure AI window. */
/* clang-format off */
static constexpr NWidgetPart _nested_ai_config_widgets[] = { static constexpr NWidgetPart _nested_ai_config_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_MAUVE), NWidget(WWT_CLOSEBOX, COLOUR_MAUVE),
@ -81,6 +82,7 @@ static constexpr NWidgetPart _nested_ai_config_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** Window definition for the configure AI window. */ /** Window definition for the configure AI window. */
static WindowDesc _ai_config_desc( static WindowDesc _ai_config_desc(

View File

@ -197,6 +197,7 @@ struct BuildAirToolbarWindow : Window {
}, AirportToolbarGlobalHotkeys}; }, AirportToolbarGlobalHotkeys};
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_air_toolbar_widgets[] = { static constexpr NWidgetPart _nested_air_toolbar_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
@ -209,6 +210,7 @@ static constexpr NWidgetPart _nested_air_toolbar_widgets[] = {
NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, WID_AT_DEMOLISH), SetFill(0, 1), SetMinimalSize(22, 22), SetSpriteTip(SPR_IMG_DYNAMITE, STR_TOOLTIP_DEMOLISH_BUILDINGS_ETC), NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, WID_AT_DEMOLISH), SetFill(0, 1), SetMinimalSize(22, 22), SetSpriteTip(SPR_IMG_DYNAMITE, STR_TOOLTIP_DEMOLISH_BUILDINGS_ETC),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _air_toolbar_desc( static WindowDesc _air_toolbar_desc(
WDP_ALIGN_TOOLBAR, "toolbar_air", 0, 0, WDP_ALIGN_TOOLBAR, "toolbar_air", 0, 0,
@ -580,6 +582,7 @@ public:
}}; }};
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_build_airport_widgets[] = { static constexpr NWidgetPart _nested_build_airport_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
@ -616,6 +619,7 @@ static constexpr NWidgetPart _nested_build_airport_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _build_airport_desc( static WindowDesc _build_airport_desc(
WDP_AUTO, nullptr, 0, 0, WDP_AUTO, nullptr, 0, 0,

View File

@ -699,6 +699,7 @@ public:
} }
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_replace_rail_vehicle_widgets[] = { static constexpr NWidgetPart _nested_replace_rail_vehicle_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -755,6 +756,7 @@ static constexpr NWidgetPart _nested_replace_rail_vehicle_widgets[] = {
NWidget(WWT_RESIZEBOX, COLOUR_GREY), NWidget(WWT_RESIZEBOX, COLOUR_GREY),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _replace_rail_vehicle_desc( static WindowDesc _replace_rail_vehicle_desc(
WDP_AUTO, "replace_vehicle_train", 500, 140, WDP_AUTO, "replace_vehicle_train", 500, 140,
@ -763,6 +765,7 @@ static WindowDesc _replace_rail_vehicle_desc(
_nested_replace_rail_vehicle_widgets _nested_replace_rail_vehicle_widgets
); );
/* clang-format off */
static constexpr NWidgetPart _nested_replace_road_vehicle_widgets[] = { static constexpr NWidgetPart _nested_replace_road_vehicle_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -813,6 +816,7 @@ static constexpr NWidgetPart _nested_replace_road_vehicle_widgets[] = {
NWidget(WWT_RESIZEBOX, COLOUR_GREY), NWidget(WWT_RESIZEBOX, COLOUR_GREY),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _replace_road_vehicle_desc( static WindowDesc _replace_road_vehicle_desc(
WDP_AUTO, "replace_vehicle_road", 500, 140, WDP_AUTO, "replace_vehicle_road", 500, 140,
@ -821,6 +825,7 @@ static WindowDesc _replace_road_vehicle_desc(
_nested_replace_road_vehicle_widgets _nested_replace_road_vehicle_widgets
); );
/* clang-format off */
static constexpr NWidgetPart _nested_replace_vehicle_widgets[] = { static constexpr NWidgetPart _nested_replace_vehicle_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -867,6 +872,7 @@ static constexpr NWidgetPart _nested_replace_vehicle_widgets[] = {
NWidget(WWT_RESIZEBOX, COLOUR_GREY), NWidget(WWT_RESIZEBOX, COLOUR_GREY),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _replace_vehicle_desc( static WindowDesc _replace_vehicle_desc(
WDP_AUTO, "replace_vehicle", 456, 118, WDP_AUTO, "replace_vehicle", 456, 118,

View File

@ -33,10 +33,12 @@
#include "safeguards.h" #include "safeguards.h"
/** Widgets for the background window to prevent smearing. */ /** Widgets for the background window to prevent smearing. */
/* clang-format off */
static constexpr NWidgetPart _background_widgets[] = { static constexpr NWidgetPart _background_widgets[] = {
NWidget(WWT_PANEL, COLOUR_DARK_BLUE, WID_BB_BACKGROUND), SetResize(1, 1), NWidget(WWT_PANEL, COLOUR_DARK_BLUE, WID_BB_BACKGROUND), SetResize(1, 1),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** /**
* Window description for the background window to prevent smearing. * Window description for the background window to prevent smearing.
@ -66,6 +68,7 @@ public:
}; };
/** Nested widgets for the error window. */ /** Nested widgets for the error window. */
/* clang-format off */
static constexpr NWidgetPart _nested_bootstrap_errmsg_widgets[] = { static constexpr NWidgetPart _nested_bootstrap_errmsg_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CAPTION, COLOUR_GREY, WID_BEM_CAPTION), SetStringTip(STR_MISSING_GRAPHICS_ERROR_TITLE), NWidget(WWT_CAPTION, COLOUR_GREY, WID_BEM_CAPTION), SetStringTip(STR_MISSING_GRAPHICS_ERROR_TITLE),
@ -75,6 +78,7 @@ static constexpr NWidgetPart _nested_bootstrap_errmsg_widgets[] = {
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_BEM_QUIT), SetStringTip(STR_MISSING_GRAPHICS_ERROR_QUIT), SetFill(1, 0), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_BEM_QUIT), SetStringTip(STR_MISSING_GRAPHICS_ERROR_QUIT), SetFill(1, 0),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** Window description for the error window. */ /** Window description for the error window. */
static WindowDesc _bootstrap_errmsg_desc( static WindowDesc _bootstrap_errmsg_desc(
@ -123,6 +127,7 @@ public:
}; };
/** Nested widgets for the download window. */ /** Nested widgets for the download window. */
/* clang-format off */
static constexpr NWidgetPart _nested_bootstrap_download_status_window_widgets[] = { static constexpr NWidgetPart _nested_bootstrap_download_status_window_widgets[] = {
NWidget(WWT_CAPTION, COLOUR_GREY), SetStringTip(STR_CONTENT_DOWNLOAD_TITLE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), NWidget(WWT_CAPTION, COLOUR_GREY), SetStringTip(STR_CONTENT_DOWNLOAD_TITLE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_PANEL, COLOUR_GREY), NWidget(WWT_PANEL, COLOUR_GREY),
@ -132,6 +137,7 @@ static constexpr NWidgetPart _nested_bootstrap_download_status_window_widgets[]
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** Window description for the download window */ /** Window description for the download window */
static WindowDesc _bootstrap_download_status_window_desc( static WindowDesc _bootstrap_download_status_window_desc(
@ -174,6 +180,7 @@ public:
}; };
/** The widgets for the query. It has no close box as that sprite does not exist yet. */ /** The widgets for the query. It has no close box as that sprite does not exist yet. */
/* clang-format off */
static constexpr NWidgetPart _bootstrap_query_widgets[] = { static constexpr NWidgetPart _bootstrap_query_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CAPTION, COLOUR_GREY), SetStringTip(STR_MISSING_GRAPHICS_SET_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), NWidget(WWT_CAPTION, COLOUR_GREY), SetStringTip(STR_MISSING_GRAPHICS_SET_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
@ -184,6 +191,7 @@ static constexpr NWidgetPart _bootstrap_query_widgets[] = {
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_BAFD_NO), SetStringTip(STR_MISSING_GRAPHICS_NO_QUIT), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_BAFD_NO), SetStringTip(STR_MISSING_GRAPHICS_NO_QUIT),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** The window description for the query. */ /** The window description for the query. */
static WindowDesc _bootstrap_query_desc( static WindowDesc _bootstrap_query_desc(

View File

@ -309,6 +309,7 @@ const std::initializer_list<GUIBridgeList::SortFunction * const> BuildBridgeWind
}; };
/** Widgets of the bridge gui. */ /** Widgets of the bridge gui. */
/* clang-format off */
static constexpr NWidgetPart _nested_build_bridge_widgets[] = { static constexpr NWidgetPart _nested_build_bridge_widgets[] = {
/* Header */ /* Header */
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
@ -335,6 +336,7 @@ static constexpr NWidgetPart _nested_build_bridge_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** Window definition for the rail bridge selection window. */ /** Window definition for the rail bridge selection window. */
static WindowDesc _build_bridge_desc( static WindowDesc _build_bridge_desc(

View File

@ -57,6 +57,7 @@ uint GetEngineListHeight(VehicleType type)
return std::max<uint>(GetCharacterHeight(FS_NORMAL) + WidgetDimensions::scaled.matrix.Vertical(), GetVehicleImageCellSize(type, EIT_PURCHASE).height); return std::max<uint>(GetCharacterHeight(FS_NORMAL) + WidgetDimensions::scaled.matrix.Vertical(), GetVehicleImageCellSize(type, EIT_PURCHASE).height);
} }
/* clang-format off */
static constexpr NWidgetPart _nested_build_vehicle_widgets[] = { static constexpr NWidgetPart _nested_build_vehicle_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -95,6 +96,7 @@ static constexpr NWidgetPart _nested_build_vehicle_widgets[] = {
NWidget(WWT_RESIZEBOX, COLOUR_GREY), NWidget(WWT_RESIZEBOX, COLOUR_GREY),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
bool _engine_sort_direction; ///< \c false = descending, \c true = ascending. bool _engine_sort_direction; ///< \c false = descending, \c true = ascending.

View File

@ -218,6 +218,7 @@ static const CheatEntry _cheats_ui[] = {
static_assert(CHT_NUM_CHEATS == lengthof(_cheats_ui)); static_assert(CHT_NUM_CHEATS == lengthof(_cheats_ui));
/** Widget definitions of the cheat GUI. */ /** Widget definitions of the cheat GUI. */
/* clang-format off */
static constexpr NWidgetPart _nested_cheat_widgets[] = { static constexpr NWidgetPart _nested_cheat_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -232,6 +233,7 @@ static constexpr NWidgetPart _nested_cheat_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** GUI for the cheats. */ /** GUI for the cheats. */
struct CheatWindow : Window { struct CheatWindow : Window {

View File

@ -284,6 +284,7 @@ static void DrawYearColumn(const Rect &r, TimerGameEconomy::Year year, const Exp
DrawPrice(sum, r.left, r.right, y, TC_WHITE); DrawPrice(sum, r.left, r.right, y, TC_WHITE);
} }
/* clang-format off */
static constexpr NWidgetPart _nested_company_finances_widgets[] = { static constexpr NWidgetPart _nested_company_finances_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -331,6 +332,7 @@ static constexpr NWidgetPart _nested_company_finances_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** Window class displaying the company finances. */ /** Window class displaying the company finances. */
struct CompanyFinancesWindow : Window { struct CompanyFinancesWindow : Window {
@ -1067,6 +1069,7 @@ public:
} }
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_select_company_livery_widgets[] = { static constexpr NWidgetPart _nested_select_company_livery_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -1098,6 +1101,7 @@ static constexpr NWidgetPart _nested_select_company_livery_widgets[] = {
NWidget(WWT_RESIZEBOX, COLOUR_GREY), NWidget(WWT_RESIZEBOX, COLOUR_GREY),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _select_company_livery_desc( static WindowDesc _select_company_livery_desc(
WDP_AUTO, "company_color_scheme", 0, 0, WDP_AUTO, "company_color_scheme", 0, 0,
@ -1165,6 +1169,7 @@ void DrawCompanyManagerFace(CompanyManagerFace cmf, Colours colour, const Rect &
} }
/** Nested widget description for the company manager face selection dialog */ /** Nested widget description for the company manager face selection dialog */
/* clang-format off */
static constexpr NWidgetPart _nested_select_company_manager_face_widgets[] = { static constexpr NWidgetPart _nested_select_company_manager_face_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -1320,6 +1325,7 @@ static constexpr NWidgetPart _nested_select_company_manager_face_widgets[] = {
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_SCMF_ACCEPT), SetFill(1, 0), SetStringTip(STR_BUTTON_OK, STR_FACE_OK_TOOLTIP), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_SCMF_ACCEPT), SetFill(1, 0), SetStringTip(STR_BUTTON_OK, STR_FACE_OK_TOOLTIP),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** Management class for customizing the face of the company manager. */ /** Management class for customizing the face of the company manager. */
class SelectCompanyManagerFaceWindow : public Window class SelectCompanyManagerFaceWindow : public Window
@ -1724,6 +1730,7 @@ static void DoSelectCompanyManagerFace(Window *parent)
new SelectCompanyManagerFaceWindow(_select_company_manager_face_desc, parent); new SelectCompanyManagerFaceWindow(_select_company_manager_face_desc, parent);
} }
/* clang-format off */
static constexpr NWidgetPart _nested_company_infrastructure_widgets[] = { static constexpr NWidgetPart _nested_company_infrastructure_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -1742,6 +1749,7 @@ static constexpr NWidgetPart _nested_company_infrastructure_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** /**
* Window with detailed information about the company's infrastructure. * Window with detailed information about the company's infrastructure.
@ -2028,6 +2036,7 @@ static void ShowCompanyInfrastructure(CompanyID company)
AllocateWindowDescFront<CompanyInfrastructureWindow>(_company_infrastructure_desc, company); AllocateWindowDescFront<CompanyInfrastructureWindow>(_company_infrastructure_desc, company);
} }
/* clang-format off */
static constexpr NWidgetPart _nested_company_widgets[] = { static constexpr NWidgetPart _nested_company_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -2103,6 +2112,7 @@ static constexpr NWidgetPart _nested_company_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** Strings for the company vehicle counts */ /** Strings for the company vehicle counts */
static const StringID _company_view_vehicle_count_strings[] = { static const StringID _company_view_vehicle_count_strings[] = {
@ -2591,6 +2601,7 @@ private:
Money company_value{}; ///< The value of the company for which the user can buy it. Money company_value{}; ///< The value of the company for which the user can buy it.
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_buy_company_widgets[] = { static constexpr NWidgetPart _nested_buy_company_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_LIGHT_BLUE), NWidget(WWT_CLOSEBOX, COLOUR_LIGHT_BLUE),
@ -2609,6 +2620,7 @@ static constexpr NWidgetPart _nested_buy_company_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _buy_company_desc( static WindowDesc _buy_company_desc(
WDP_AUTO, nullptr, 0, 0, WDP_AUTO, nullptr, 0, 0,

View File

@ -132,9 +132,11 @@ static inline void IConsoleResetHistoryPos()
static const char *IConsoleHistoryAdd(const char *cmd); static const char *IConsoleHistoryAdd(const char *cmd);
static void IConsoleHistoryNavigate(int direction); static void IConsoleHistoryNavigate(int direction);
/* clang-format off */
static constexpr NWidgetPart _nested_console_window_widgets[] = { static constexpr NWidgetPart _nested_console_window_widgets[] = {
NWidget(WWT_EMPTY, INVALID_COLOUR, WID_C_BACKGROUND), SetResize(1, 1), NWidget(WWT_EMPTY, INVALID_COLOUR, WID_C_BACKGROUND), SetResize(1, 1),
}; };
/* clang-format on */
static WindowDesc _console_window_desc( static WindowDesc _console_window_desc(
WDP_MANUAL, nullptr, 0, 0, WDP_MANUAL, nullptr, 0, 0,

View File

@ -173,6 +173,7 @@ struct SetDateWindow : Window {
}; };
/** Widgets for the date setting window. */ /** Widgets for the date setting window. */
/* clang-format off */
static constexpr NWidgetPart _nested_set_date_widgets[] = { static constexpr NWidgetPart _nested_set_date_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN), NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
@ -193,6 +194,7 @@ static constexpr NWidgetPart _nested_set_date_widgets[] = {
EndContainer(), EndContainer(),
EndContainer() EndContainer()
}; };
/* clang-format on */
/** Description of the date setting window. */ /** Description of the date setting window. */
static WindowDesc _set_date_desc( static WindowDesc _set_date_desc(

View File

@ -46,6 +46,7 @@
*/ */
/** Nested widget definition for train depots. */ /** Nested widget definition for train depots. */
/* clang-format off */
static constexpr NWidgetPart _nested_train_depot_widgets[] = { static constexpr NWidgetPart _nested_train_depot_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -84,6 +85,7 @@ static constexpr NWidgetPart _nested_train_depot_widgets[] = {
NWidget(WWT_RESIZEBOX, COLOUR_GREY), NWidget(WWT_RESIZEBOX, COLOUR_GREY),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _train_depot_desc( static WindowDesc _train_depot_desc(
WDP_AUTO, "depot_train", 362, 123, WDP_AUTO, "depot_train", 362, 123,

View File

@ -333,6 +333,7 @@ struct BuildDocksToolbarWindow : Window {
* Nested widget parts of docks toolbar, game version. * Nested widget parts of docks toolbar, game version.
* Position of #WID_DT_RIVER widget has changed. * Position of #WID_DT_RIVER widget has changed.
*/ */
/* clang-format off */
static constexpr NWidgetPart _nested_build_docks_toolbar_widgets[] = { static constexpr NWidgetPart _nested_build_docks_toolbar_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
@ -350,6 +351,7 @@ static constexpr NWidgetPart _nested_build_docks_toolbar_widgets[] = {
NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, WID_DT_BUILD_AQUEDUCT), SetMinimalSize(23, 22), SetFill(0, 1), SetSpriteTip(SPR_IMG_AQUEDUCT, STR_WATERWAYS_TOOLBAR_BUILD_AQUEDUCT_TOOLTIP), NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, WID_DT_BUILD_AQUEDUCT), SetMinimalSize(23, 22), SetFill(0, 1), SetSpriteTip(SPR_IMG_AQUEDUCT, STR_WATERWAYS_TOOLBAR_BUILD_AQUEDUCT_TOOLTIP),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _build_docks_toolbar_desc( static WindowDesc _build_docks_toolbar_desc(
WDP_ALIGN_TOOLBAR, "toolbar_water", 0, 0, WDP_ALIGN_TOOLBAR, "toolbar_water", 0, 0,
@ -378,6 +380,7 @@ Window *ShowBuildDocksToolbar()
* Nested widget parts of docks toolbar, scenario editor version. * Nested widget parts of docks toolbar, scenario editor version.
* Positions of #WID_DT_DEPOT, #WID_DT_STATION, and #WID_DT_BUOY widgets have changed. * Positions of #WID_DT_DEPOT, #WID_DT_STATION, and #WID_DT_BUOY widgets have changed.
*/ */
/* clang-format off */
static constexpr NWidgetPart _nested_build_docks_scen_toolbar_widgets[] = { static constexpr NWidgetPart _nested_build_docks_scen_toolbar_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
@ -393,6 +396,7 @@ static constexpr NWidgetPart _nested_build_docks_scen_toolbar_widgets[] = {
NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, WID_DT_BUILD_AQUEDUCT), SetMinimalSize(22, 22), SetFill(0, 1), SetSpriteTip(SPR_IMG_AQUEDUCT, STR_WATERWAYS_TOOLBAR_BUILD_AQUEDUCT_TOOLTIP), NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, WID_DT_BUILD_AQUEDUCT), SetMinimalSize(22, 22), SetFill(0, 1), SetSpriteTip(SPR_IMG_AQUEDUCT, STR_WATERWAYS_TOOLBAR_BUILD_AQUEDUCT_TOOLTIP),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** Window definition for the build docks in scenario editor window. */ /** Window definition for the build docks in scenario editor window. */
static WindowDesc _build_docks_scen_toolbar_desc( static WindowDesc _build_docks_scen_toolbar_desc(
@ -487,6 +491,7 @@ public:
}; };
/** Nested widget parts of a build dock station window. */ /** Nested widget parts of a build dock station window. */
/* clang-format off */
static constexpr NWidgetPart _nested_build_dock_station_widgets[] = { static constexpr NWidgetPart _nested_build_dock_station_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
@ -505,6 +510,7 @@ static constexpr NWidgetPart _nested_build_dock_station_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _build_dock_station_desc( static WindowDesc _build_dock_station_desc(
WDP_AUTO, nullptr, 0, 0, WDP_AUTO, nullptr, 0, 0,
@ -588,6 +594,7 @@ public:
} }
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_build_docks_depot_widgets[] = { static constexpr NWidgetPart _nested_build_docks_depot_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
@ -600,6 +607,7 @@ static constexpr NWidgetPart _nested_build_docks_depot_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _build_docks_depot_desc( static WindowDesc _build_docks_depot_desc(
WDP_AUTO, nullptr, 0, 0, WDP_AUTO, nullptr, 0, 0,

View File

@ -55,6 +55,7 @@ std::unique_ptr<DropDownListItem> MakeDropDownListCheckedItem(bool checked, Stri
return std::make_unique<DropDownListCheckedItem>(indent, checked, GetString(str), value, masked, shaded); return std::make_unique<DropDownListCheckedItem>(indent, checked, GetString(str), value, masked, shaded);
} }
/* clang-format off */
static constexpr NWidgetPart _nested_dropdown_menu_widgets[] = { static constexpr NWidgetPart _nested_dropdown_menu_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_PANEL, COLOUR_END, WID_DM_ITEMS), SetScrollbar(WID_DM_SCROLL), EndContainer(), NWidget(WWT_PANEL, COLOUR_END, WID_DM_ITEMS), SetScrollbar(WID_DM_SCROLL), EndContainer(),
@ -63,6 +64,7 @@ static constexpr NWidgetPart _nested_dropdown_menu_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _dropdown_desc( static WindowDesc _dropdown_desc(
WDP_MANUAL, nullptr, 0, 0, WDP_MANUAL, nullptr, 0, 0,

View File

@ -51,6 +51,7 @@ StringID GetEngineCategoryName(EngineID engine)
} }
} }
/* clang-format off */
static constexpr NWidgetPart _nested_engine_preview_widgets[] = { static constexpr NWidgetPart _nested_engine_preview_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_LIGHT_BLUE), NWidget(WWT_CLOSEBOX, COLOUR_LIGHT_BLUE),
@ -66,6 +67,7 @@ static constexpr NWidgetPart _nested_engine_preview_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
struct EnginePreviewWindow : Window { struct EnginePreviewWindow : Window {
int vehicle_space = 0; // The space to show the vehicle image int vehicle_space = 0; // The space to show the vehicle image

View File

@ -33,6 +33,7 @@
#include "safeguards.h" #include "safeguards.h"
/* clang-format off */
static constexpr NWidgetPart _nested_errmsg_widgets[] = { static constexpr NWidgetPart _nested_errmsg_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_RED), NWidget(WWT_CLOSEBOX, COLOUR_RED),
@ -42,6 +43,7 @@ static constexpr NWidgetPart _nested_errmsg_widgets[] = {
NWidget(WWT_EMPTY, INVALID_COLOUR, WID_EM_MESSAGE), SetPadding(WidgetDimensions::unscaled.modalpopup), SetFill(1, 0), SetMinimalSize(236, 0), NWidget(WWT_EMPTY, INVALID_COLOUR, WID_EM_MESSAGE), SetPadding(WidgetDimensions::unscaled.modalpopup), SetFill(1, 0), SetMinimalSize(236, 0),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _errmsg_desc( static WindowDesc _errmsg_desc(
WDP_MANUAL, nullptr, 0, 0, WDP_MANUAL, nullptr, 0, 0,
@ -50,6 +52,7 @@ static WindowDesc _errmsg_desc(
_nested_errmsg_widgets _nested_errmsg_widgets
); );
/* clang-format off */
static constexpr NWidgetPart _nested_errmsg_face_widgets[] = { static constexpr NWidgetPart _nested_errmsg_face_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_RED), NWidget(WWT_CLOSEBOX, COLOUR_RED),
@ -62,6 +65,7 @@ static constexpr NWidgetPart _nested_errmsg_face_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _errmsg_face_desc( static WindowDesc _errmsg_face_desc(
WDP_MANUAL, nullptr, 0, 0, WDP_MANUAL, nullptr, 0, 0,

View File

@ -65,6 +65,7 @@ void LoadCheckData::Clear()
} }
/** Load game/scenario with optional content download */ /** Load game/scenario with optional content download */
/* clang-format off */
static constexpr NWidgetPart _nested_load_dialog_widgets[] = { static constexpr NWidgetPart _nested_load_dialog_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -126,8 +127,10 @@ static constexpr NWidgetPart _nested_load_dialog_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** Load heightmap with content download */ /** Load heightmap with content download */
/* clang-format off */
static constexpr NWidgetPart _nested_load_heightmap_dialog_widgets[] = { static constexpr NWidgetPart _nested_load_heightmap_dialog_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -173,8 +176,10 @@ static constexpr NWidgetPart _nested_load_heightmap_dialog_widgets[] = {
NWidget(WWT_RESIZEBOX, COLOUR_GREY), NWidget(WWT_RESIZEBOX, COLOUR_GREY),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** Load town data */ /** Load town data */
/* clang-format off */
static constexpr NWidgetPart _nested_load_town_data_dialog_widgets[] = { static constexpr NWidgetPart _nested_load_town_data_dialog_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -215,8 +220,10 @@ static constexpr NWidgetPart _nested_load_town_data_dialog_widgets[] = {
NWidget(WWT_RESIZEBOX, COLOUR_GREY), NWidget(WWT_RESIZEBOX, COLOUR_GREY),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** Save game/scenario */ /** Save game/scenario */
/* clang-format off */
static constexpr NWidgetPart _nested_save_dialog_widgets[] = { static constexpr NWidgetPart _nested_save_dialog_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -279,6 +286,7 @@ static constexpr NWidgetPart _nested_save_dialog_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** Text colours of #DetailedFileType fios entries in the window. */ /** Text colours of #DetailedFileType fios entries in the window. */
static const TextColour _fios_colours[] = { static const TextColour _fios_colours[] = {

View File

@ -376,6 +376,7 @@ static const char * GetAIName(int ai_index)
} }
/** @hideinitializer */ /** @hideinitializer */
/* clang-format off */
static constexpr NWidgetPart _framerate_window_widgets[] = { static constexpr NWidgetPart _framerate_window_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -408,6 +409,7 @@ static constexpr NWidgetPart _framerate_window_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
struct FramerateWindow : Window { struct FramerateWindow : Window {
int num_active = 0; int num_active = 0;
@ -694,6 +696,7 @@ static WindowDesc _framerate_display_desc(
/** @hideinitializer */ /** @hideinitializer */
/* clang-format off */
static constexpr NWidgetPart _frametime_graph_window_widgets[] = { static constexpr NWidgetPart _frametime_graph_window_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -706,6 +709,7 @@ static constexpr NWidgetPart _frametime_graph_window_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
struct FrametimeGraphWindow : Window { struct FrametimeGraphWindow : Window {
int vertical_scale = TIMESTAMP_PRECISION / 10; ///< number of TIMESTAMP_PRECISION units vertically int vertical_scale = TIMESTAMP_PRECISION / 10; ///< number of TIMESTAMP_PRECISION units vertically

View File

@ -32,6 +32,7 @@
/** Widgets for the configure GS window. */ /** Widgets for the configure GS window. */
/* clang-format off */
static constexpr NWidgetPart _nested_gs_config_widgets[] = { static constexpr NWidgetPart _nested_gs_config_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_MAUVE), NWidget(WWT_CLOSEBOX, COLOUR_MAUVE),
@ -73,6 +74,7 @@ static constexpr NWidgetPart _nested_gs_config_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** Window definition for the configure GS window. */ /** Window definition for the configure GS window. */
static WindowDesc _gs_config_desc( static WindowDesc _gs_config_desc(

View File

@ -73,6 +73,7 @@ void SetNewLandscapeType(LandscapeType landscape)
} }
/** Widgets of GenerateLandscapeWindow when generating world */ /** Widgets of GenerateLandscapeWindow when generating world */
/* clang-format off */
static constexpr NWidgetPart _nested_generate_landscape_widgets[] = { static constexpr NWidgetPart _nested_generate_landscape_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN), NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
@ -195,8 +196,10 @@ static constexpr NWidgetPart _nested_generate_landscape_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** Widgets of GenerateLandscapeWindow when loading heightmap */ /** Widgets of GenerateLandscapeWindow when loading heightmap */
/* clang-format off */
static constexpr NWidgetPart _nested_heightmap_load_widgets[] = { static constexpr NWidgetPart _nested_heightmap_load_widgets[] = {
/* Window header. */ /* Window header. */
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
@ -312,6 +315,7 @@ static constexpr NWidgetPart _nested_heightmap_load_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static void StartGeneratingLandscape(GenerateLandscapeWindowMode mode) static void StartGeneratingLandscape(GenerateLandscapeWindowMode mode)
{ {
@ -1218,6 +1222,7 @@ struct CreateScenarioWindow : public Window
} }
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_create_scenario_widgets[] = { static constexpr NWidgetPart _nested_create_scenario_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN), NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
@ -1276,6 +1281,7 @@ static constexpr NWidgetPart _nested_create_scenario_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _create_scenario_desc( static WindowDesc _create_scenario_desc(
WDP_CENTER, nullptr, 0, 0, WDP_CENTER, nullptr, 0, 0,
@ -1291,6 +1297,7 @@ void ShowCreateScenario()
new CreateScenarioWindow(_create_scenario_desc, GLWM_SCENARIO); new CreateScenarioWindow(_create_scenario_desc, GLWM_SCENARIO);
} }
/* clang-format off */
static constexpr NWidgetPart _nested_generate_progress_widgets[] = { static constexpr NWidgetPart _nested_generate_progress_widgets[] = {
NWidget(WWT_CAPTION, COLOUR_GREY), SetStringTip(STR_GENERATION_WORLD, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), NWidget(WWT_CAPTION, COLOUR_GREY), SetStringTip(STR_GENERATION_WORLD, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_PANEL, COLOUR_GREY), NWidget(WWT_PANEL, COLOUR_GREY),
@ -1301,6 +1308,7 @@ static constexpr NWidgetPart _nested_generate_progress_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _generate_progress_desc( static WindowDesc _generate_progress_desc(

View File

@ -275,6 +275,7 @@ struct GoalListWindow : public Window {
}; };
/** Widgets of the #GoalListWindow. */ /** Widgets of the #GoalListWindow. */
/* clang-format off */
static constexpr NWidgetPart _nested_goals_list_widgets[] = { static constexpr NWidgetPart _nested_goals_list_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN), NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
@ -296,6 +297,7 @@ static constexpr NWidgetPart _nested_goals_list_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _goals_list_desc( static WindowDesc _goals_list_desc(
WDP_AUTO, "list_goals", 500, 127, WDP_AUTO, "list_goals", 500, 127,

View File

@ -129,6 +129,7 @@ static std::unique_ptr<NWidgetBase> MakeNWidgetCompanyLines()
return vert; return vert;
} }
/* clang-format off */
static constexpr NWidgetPart _nested_graph_legend_widgets[] = { static constexpr NWidgetPart _nested_graph_legend_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN), NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
@ -140,6 +141,7 @@ static constexpr NWidgetPart _nested_graph_legend_widgets[] = {
NWidgetFunction(MakeNWidgetCompanyLines), NWidgetFunction(MakeNWidgetCompanyLines),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _graph_legend_desc( static WindowDesc _graph_legend_desc(
WDP_AUTO, "graph_legend", 0, 0, WDP_AUTO, "graph_legend", 0, 0,
@ -790,6 +792,7 @@ struct OperatingProfitGraphWindow : BaseGraphWindow {
} }
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_operating_profit_widgets[] = { static constexpr NWidgetPart _nested_operating_profit_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN), NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
@ -811,6 +814,7 @@ static constexpr NWidgetPart _nested_operating_profit_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _operating_profit_desc( static WindowDesc _operating_profit_desc(
WDP_AUTO, "graph_operating_profit", 0, 0, WDP_AUTO, "graph_operating_profit", 0, 0,
@ -847,6 +851,7 @@ struct IncomeGraphWindow : BaseGraphWindow {
} }
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_income_graph_widgets[] = { static constexpr NWidgetPart _nested_income_graph_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN), NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
@ -868,6 +873,7 @@ static constexpr NWidgetPart _nested_income_graph_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _income_graph_desc( static WindowDesc _income_graph_desc(
WDP_AUTO, "graph_income", 0, 0, WDP_AUTO, "graph_income", 0, 0,
@ -902,6 +908,7 @@ struct DeliveredCargoGraphWindow : BaseGraphWindow {
} }
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_delivered_cargo_graph_widgets[] = { static constexpr NWidgetPart _nested_delivered_cargo_graph_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN), NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
@ -923,6 +930,7 @@ static constexpr NWidgetPart _nested_delivered_cargo_graph_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _delivered_cargo_graph_desc( static WindowDesc _delivered_cargo_graph_desc(
WDP_AUTO, "graph_delivered_cargo", 0, 0, WDP_AUTO, "graph_delivered_cargo", 0, 0,
@ -963,6 +971,7 @@ struct PerformanceHistoryGraphWindow : BaseGraphWindow {
} }
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_performance_history_widgets[] = { static constexpr NWidgetPart _nested_performance_history_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN), NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
@ -985,6 +994,7 @@ static constexpr NWidgetPart _nested_performance_history_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _performance_history_desc( static WindowDesc _performance_history_desc(
WDP_AUTO, "graph_performance", 0, 0, WDP_AUTO, "graph_performance", 0, 0,
@ -1019,6 +1029,7 @@ struct CompanyValueGraphWindow : BaseGraphWindow {
} }
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_company_value_graph_widgets[] = { static constexpr NWidgetPart _nested_company_value_graph_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN), NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
@ -1040,6 +1051,7 @@ static constexpr NWidgetPart _nested_company_value_graph_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _company_value_graph_desc( static WindowDesc _company_value_graph_desc(
WDP_AUTO, "graph_company_value", 0, 0, WDP_AUTO, "graph_company_value", 0, 0,
@ -1236,6 +1248,7 @@ struct PaymentRatesGraphWindow : BaseGraphWindow {
} }
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_cargo_payment_rates_widgets[] = { static constexpr NWidgetPart _nested_cargo_payment_rates_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN), NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
@ -1273,6 +1286,7 @@ static constexpr NWidgetPart _nested_cargo_payment_rates_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _cargo_payment_rates_desc( static WindowDesc _cargo_payment_rates_desc(
WDP_AUTO, "graph_cargo_payment_rates", 0, 0, WDP_AUTO, "graph_cargo_payment_rates", 0, 0,
@ -1751,6 +1765,7 @@ struct IndustryProductionGraphWindow : BaseGraphWindow {
} }
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_industry_production_widgets[] = { static constexpr NWidgetPart _nested_industry_production_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN), NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
@ -1785,6 +1800,7 @@ static constexpr NWidgetPart _nested_industry_production_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _industry_production_desc( static WindowDesc _industry_production_desc(
WDP_AUTO, "graph_industry_production", 0, 0, WDP_AUTO, "graph_industry_production", 0, 0,
@ -1836,6 +1852,7 @@ std::unique_ptr<NWidgetBase> MakeCompanyButtonRowsGraphGUI()
return MakeCompanyButtonRows(WID_PRD_COMPANY_FIRST, WID_PRD_COMPANY_LAST, COLOUR_BROWN, 8, STR_PERFORMANCE_DETAIL_SELECT_COMPANY_TOOLTIP); return MakeCompanyButtonRows(WID_PRD_COMPANY_FIRST, WID_PRD_COMPANY_LAST, COLOUR_BROWN, 8, STR_PERFORMANCE_DETAIL_SELECT_COMPANY_TOOLTIP);
} }
/* clang-format off */
static constexpr NWidgetPart _nested_performance_rating_detail_widgets[] = { static constexpr NWidgetPart _nested_performance_rating_detail_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN), NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
@ -1848,6 +1865,7 @@ static constexpr NWidgetPart _nested_performance_rating_detail_widgets[] = {
EndContainer(), EndContainer(),
NWidgetFunction(MakePerformanceDetailPanels), NWidgetFunction(MakePerformanceDetailPanels),
}; };
/* clang-format on */
static WindowDesc _performance_rating_detail_desc( static WindowDesc _performance_rating_detail_desc(
WDP_AUTO, "league_details", 0, 0, WDP_AUTO, "league_details", 0, 0,

View File

@ -38,6 +38,7 @@
#include "safeguards.h" #include "safeguards.h"
/* clang-format off */
static constexpr NWidgetPart _nested_group_widgets[] = { static constexpr NWidgetPart _nested_group_widgets[] = {
NWidget(NWID_HORIZONTAL), // Window header NWidget(NWID_HORIZONTAL), // Window header
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -110,6 +111,7 @@ static constexpr NWidgetPart _nested_group_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** /**
* Add children to GUI group list to build a hierarchical tree. * Add children to GUI group list to build a hierarchical tree.

View File

@ -175,6 +175,7 @@ private:
} }
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_helpwin_widgets[] = { static constexpr NWidgetPart _nested_helpwin_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
@ -200,6 +201,7 @@ static constexpr NWidgetPart _nested_helpwin_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _helpwin_desc( static WindowDesc _helpwin_desc(
WDP_CENTER, nullptr, 0, 0, WDP_CENTER, nullptr, 0, 0,

View File

@ -209,9 +209,11 @@ struct HighScoreWindow : EndGameHighScoreBaseWindow {
} }
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_highscore_widgets[] = { static constexpr NWidgetPart _nested_highscore_widgets[] = {
NWidget(WWT_PANEL, COLOUR_BROWN, WID_H_BACKGROUND), SetResize(1, 1), EndContainer(), NWidget(WWT_PANEL, COLOUR_BROWN, WID_H_BACKGROUND), SetResize(1, 1), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _highscore_desc( static WindowDesc _highscore_desc(
WDP_MANUAL, nullptr, 0, 0, WDP_MANUAL, nullptr, 0, 0,

View File

@ -262,6 +262,7 @@ void CcBuildIndustry(Commands, const CommandCost &result, TileIndex tile, Indust
} }
} }
/* clang-format off */
static constexpr NWidgetPart _nested_build_industry_widgets[] = { static constexpr NWidgetPart _nested_build_industry_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
@ -291,6 +292,7 @@ static constexpr NWidgetPart _nested_build_industry_widgets[] = {
NWidget(WWT_RESIZEBOX, COLOUR_DARK_GREEN), NWidget(WWT_RESIZEBOX, COLOUR_DARK_GREEN),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** Window definition of the dynamic place industries gui */ /** Window definition of the dynamic place industries gui */
static WindowDesc _build_industry_desc( static WindowDesc _build_industry_desc(
@ -1199,6 +1201,7 @@ static void UpdateIndustryProduction(Industry *i)
} }
/** Widget definition of the view industry gui */ /** Widget definition of the view industry gui */
/* clang-format off */
static constexpr NWidgetPart _nested_industry_view_widgets[] = { static constexpr NWidgetPart _nested_industry_view_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_CREAM), NWidget(WWT_CLOSEBOX, COLOUR_CREAM),
@ -1222,6 +1225,7 @@ static constexpr NWidgetPart _nested_industry_view_widgets[] = {
NWidget(WWT_RESIZEBOX, COLOUR_CREAM), NWidget(WWT_RESIZEBOX, COLOUR_CREAM),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** Window definition of the view industry gui */ /** Window definition of the view industry gui */
static WindowDesc _industry_view_desc( static WindowDesc _industry_view_desc(
@ -1237,6 +1241,7 @@ void ShowIndustryViewWindow(IndustryID industry)
} }
/** Widget definition of the industry directory gui */ /** Widget definition of the industry directory gui */
/* clang-format off */
static constexpr NWidgetPart _nested_industry_directory_widgets[] = { static constexpr NWidgetPart _nested_industry_directory_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN), NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
@ -1267,6 +1272,7 @@ static constexpr NWidgetPart _nested_industry_directory_widgets[] = {
NWidget(WWT_RESIZEBOX, COLOUR_BROWN), NWidget(WWT_RESIZEBOX, COLOUR_BROWN),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
typedef GUIList<const Industry *, const CargoType &, const std::pair<CargoType, CargoType> &> GUIIndustryList; typedef GUIList<const Industry *, const CargoType &, const std::pair<CargoType, CargoType> &> GUIIndustryList;
@ -1943,6 +1949,7 @@ void ShowIndustryDirectory()
} }
/** Widgets of the industry cargoes window. */ /** Widgets of the industry cargoes window. */
/* clang-format off */
static constexpr NWidgetPart _nested_industry_cargoes_widgets[] = { static constexpr NWidgetPart _nested_industry_cargoes_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN), NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
@ -1966,6 +1973,7 @@ static constexpr NWidgetPart _nested_industry_cargoes_widgets[] = {
NWidget(WWT_RESIZEBOX, COLOUR_BROWN), NWidget(WWT_RESIZEBOX, COLOUR_BROWN),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** Window description for the industry cargoes window. */ /** Window description for the industry cargoes window. */
static WindowDesc _industry_cargoes_desc( static WindowDesc _industry_cargoes_desc(

View File

@ -367,6 +367,7 @@ struct SelectGameWindow : public Window {
} }
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_select_game_widgets[] = { static constexpr NWidgetPart _nested_select_game_widgets[] = {
NWidget(WWT_CAPTION, COLOUR_BROWN), SetStringTip(STR_INTRO_CAPTION), NWidget(WWT_CAPTION, COLOUR_BROWN), SetStringTip(STR_INTRO_CAPTION),
NWidget(WWT_PANEL, COLOUR_BROWN), NWidget(WWT_PANEL, COLOUR_BROWN),
@ -445,6 +446,7 @@ static constexpr NWidgetPart _nested_select_game_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _select_game_desc( static WindowDesc _select_game_desc(
WDP_CENTER, nullptr, 0, 0, WDP_CENTER, nullptr, 0, 0,

View File

@ -181,6 +181,7 @@ public:
} }
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_performance_league_widgets[] = { static constexpr NWidgetPart _nested_performance_league_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN), NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
@ -191,6 +192,7 @@ static constexpr NWidgetPart _nested_performance_league_widgets[] = {
NWidget(WWT_PANEL, COLOUR_BROWN, WID_PLT_BACKGROUND), SetMinimalSize(400, 0), SetMinimalTextLines(15, WidgetDimensions::unscaled.framerect.Vertical()), NWidget(WWT_PANEL, COLOUR_BROWN, WID_PLT_BACKGROUND), SetMinimalSize(400, 0), SetMinimalTextLines(15, WidgetDimensions::unscaled.framerect.Vertical()),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _performance_league_desc( static WindowDesc _performance_league_desc(
WDP_AUTO, "performance_league", 0, 0, WDP_AUTO, "performance_league", 0, 0,
@ -417,6 +419,7 @@ public:
} }
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_script_league_widgets[] = { static constexpr NWidgetPart _nested_script_league_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN), NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
@ -427,6 +430,7 @@ static constexpr NWidgetPart _nested_script_league_widgets[] = {
NWidget(WWT_PANEL, COLOUR_BROWN, WID_SLT_BACKGROUND), SetMinimalSize(400, 0), SetMinimalTextLines(15, WidgetDimensions::unscaled.framerect.Vertical()), NWidget(WWT_PANEL, COLOUR_BROWN, WID_SLT_BACKGROUND), SetMinimalSize(400, 0), SetMinimalTextLines(15, WidgetDimensions::unscaled.framerect.Vertical()),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _script_league_desc( static WindowDesc _script_league_desc(
WDP_AUTO, "script_league", 0, 0, WDP_AUTO, "script_league", 0, 0,

View File

@ -496,6 +496,7 @@ std::unique_ptr<NWidgetBase> MakeCargoesLegendLinkGraphGUI()
} }
/* clang-format off */
static constexpr NWidgetPart _nested_linkgraph_legend_widgets[] = { static constexpr NWidgetPart _nested_linkgraph_legend_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
@ -525,6 +526,7 @@ static constexpr NWidgetPart _nested_linkgraph_legend_widgets[] = {
EndContainer(), EndContainer(),
EndContainer() EndContainer()
}; };
/* clang-format on */
static_assert(WID_LGL_SATURATION_LAST - WID_LGL_SATURATION_FIRST == static_assert(WID_LGL_SATURATION_LAST - WID_LGL_SATURATION_FIRST ==
lengthof(LinkGraphOverlay::LINK_COLOURS[0]) - 1); lengthof(LinkGraphOverlay::LINK_COLOURS[0]) - 1);

View File

@ -177,9 +177,11 @@ void FixTitleGameZoom(int zoom_adjust)
vp.virtual_height = ScaleByZoom(vp.height, vp.zoom); vp.virtual_height = ScaleByZoom(vp.height, vp.zoom);
} }
/* clang-format off */
static constexpr NWidgetPart _nested_main_window_widgets[] = { static constexpr NWidgetPart _nested_main_window_widgets[] = {
NWidget(NWID_VIEWPORT, INVALID_COLOUR, WID_M_VIEWPORT), SetResize(1, 1), NWidget(NWID_VIEWPORT, INVALID_COLOUR, WID_M_VIEWPORT), SetResize(1, 1),
}; };
/* clang-format on */
enum GlobalHotKeys : int32_t { enum GlobalHotKeys : int32_t {
GHK_QUIT, GHK_QUIT,

View File

@ -47,6 +47,7 @@ enum OskActivation : uint8_t {
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_land_info_widgets[] = { static constexpr NWidgetPart _nested_land_info_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -56,6 +57,7 @@ static constexpr NWidgetPart _nested_land_info_widgets[] = {
EndContainer(), EndContainer(),
NWidget(WWT_PANEL, COLOUR_GREY, WID_LI_BACKGROUND), EndContainer(), NWidget(WWT_PANEL, COLOUR_GREY, WID_LI_BACKGROUND), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _land_info_desc( static WindowDesc _land_info_desc(
WDP_AUTO, nullptr, 0, 0, WDP_AUTO, nullptr, 0, 0,
@ -319,6 +321,7 @@ void ShowLandInfo(TileIndex tile)
new LandInfoWindow(tile); new LandInfoWindow(tile);
} }
/* clang-format off */
static constexpr NWidgetPart _nested_about_widgets[] = { static constexpr NWidgetPart _nested_about_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -334,6 +337,7 @@ static constexpr NWidgetPart _nested_about_widgets[] = {
NWidget(WWT_LABEL, INVALID_COLOUR, WID_A_COPYRIGHT), NWidget(WWT_LABEL, INVALID_COLOUR, WID_A_COPYRIGHT),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _about_desc( static WindowDesc _about_desc(
WDP_CENTER, nullptr, 0, 0, WDP_CENTER, nullptr, 0, 0,
@ -586,9 +590,11 @@ void HideFillingPercent(TextEffectID *te_id)
*te_id = INVALID_TE_ID; *te_id = INVALID_TE_ID;
} }
/* clang-format off */
static constexpr NWidgetPart _nested_tooltips_widgets[] = { static constexpr NWidgetPart _nested_tooltips_widgets[] = {
NWidget(WWT_EMPTY, INVALID_COLOUR, WID_TT_BACKGROUND), NWidget(WWT_EMPTY, INVALID_COLOUR, WID_TT_BACKGROUND),
}; };
/* clang-format on */
static WindowDesc _tool_tips_desc( static WindowDesc _tool_tips_desc(
WDP_MANUAL, nullptr, 0, 0, // Coordinates and sizes are not used, WDP_MANUAL, nullptr, 0, 0, // Coordinates and sizes are not used,
@ -975,6 +981,7 @@ struct QueryStringWindow : public Window
} }
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_query_string_widgets[] = { static constexpr NWidgetPart _nested_query_string_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -989,6 +996,7 @@ static constexpr NWidgetPart _nested_query_string_widgets[] = {
NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_QS_OK), SetMinimalSize(87, 12), SetFill(1, 1), SetStringTip(STR_BUTTON_OK), NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_QS_OK), SetMinimalSize(87, 12), SetFill(1, 1), SetStringTip(STR_BUTTON_OK),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _query_string_desc( static WindowDesc _query_string_desc(
WDP_CENTER, nullptr, 0, 0, WDP_CENTER, nullptr, 0, 0,
@ -1113,6 +1121,7 @@ struct QueryWindow : public Window {
} }
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_query_widgets[] = { static constexpr NWidgetPart _nested_query_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_RED), NWidget(WWT_CLOSEBOX, COLOUR_RED),
@ -1128,6 +1137,7 @@ static constexpr NWidgetPart _nested_query_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _query_desc( static WindowDesc _query_desc(
WDP_CENTER, nullptr, 0, 0, WDP_CENTER, nullptr, 0, 0,

View File

@ -623,6 +623,7 @@ struct MusicTrackSelectionWindow : public Window {
} }
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_music_track_selection_widgets[] = { static constexpr NWidgetPart _nested_music_track_selection_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -659,6 +660,7 @@ static constexpr NWidgetPart _nested_music_track_selection_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _music_track_selection_desc( static WindowDesc _music_track_selection_desc(
WDP_AUTO, nullptr, 0, 0, WDP_AUTO, nullptr, 0, 0,
@ -855,6 +857,7 @@ struct MusicWindow : public Window {
} }
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_music_window_widgets[] = { static constexpr NWidgetPart _nested_music_window_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -918,6 +921,7 @@ static constexpr NWidgetPart _nested_music_window_widgets[] = {
NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_M_CUSTOM2), SetFill(1, 0), SetStringTip(STR_MUSIC_PLAYLIST_CUSTOM_2, STR_MUSIC_TOOLTIP_SELECT_CUSTOM_2_USER_DEFINED), NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_M_CUSTOM2), SetFill(1, 0), SetStringTip(STR_MUSIC_PLAYLIST_CUSTOM_2, STR_MUSIC_TOOLTIP_SELECT_CUSTOM_2_USER_DEFINED),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _music_window_desc( static WindowDesc _music_window_desc(
WDP_AUTO, "music", 0, 0, WDP_AUTO, "music", 0, 0,

View File

@ -411,6 +411,7 @@ struct NetworkChatWindow : public Window {
}; };
/** The widgets of the chat window. */ /** The widgets of the chat window. */
/* clang-format off */
static constexpr NWidgetPart _nested_chat_window_widgets[] = { static constexpr NWidgetPart _nested_chat_window_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY, WID_NC_CLOSE), NWidget(WWT_CLOSEBOX, COLOUR_GREY, WID_NC_CLOSE),
@ -424,6 +425,7 @@ static constexpr NWidgetPart _nested_chat_window_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** The description of the chat window. */ /** The description of the chat window. */
static WindowDesc _chat_window_desc( static WindowDesc _chat_window_desc(

View File

@ -86,6 +86,7 @@ void ShowContentTextfileWindow(TextfileType file_type, const ContentInfo *ci)
} }
/** Nested widgets for the download window. */ /** Nested widgets for the download window. */
/* clang-format off */
static constexpr NWidgetPart _nested_network_content_download_status_window_widgets[] = { static constexpr NWidgetPart _nested_network_content_download_status_window_widgets[] = {
NWidget(WWT_CAPTION, COLOUR_GREY), SetStringTip(STR_CONTENT_DOWNLOAD_TITLE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), NWidget(WWT_CAPTION, COLOUR_GREY), SetStringTip(STR_CONTENT_DOWNLOAD_TITLE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_PANEL, COLOUR_GREY), NWidget(WWT_PANEL, COLOUR_GREY),
@ -96,6 +97,7 @@ static constexpr NWidgetPart _nested_network_content_download_status_window_widg
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** Window description for the download window */ /** Window description for the download window */
static WindowDesc _network_content_download_status_window_desc( static WindowDesc _network_content_download_status_window_desc(
@ -1019,6 +1021,7 @@ void BuildContentTypeStringList()
} }
/** The widgets for the content list. */ /** The widgets for the content list. */
/* clang-format off */
static constexpr NWidgetPart _nested_network_content_list_widgets[] = { static constexpr NWidgetPart _nested_network_content_list_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_LIGHT_BLUE), NWidget(WWT_CLOSEBOX, COLOUR_LIGHT_BLUE),
@ -1096,6 +1099,7 @@ static constexpr NWidgetPart _nested_network_content_list_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** Window description of the content list */ /** Window description of the content list */
static WindowDesc _network_content_list_desc( static WindowDesc _network_content_list_desc(

View File

@ -858,6 +858,7 @@ static std::unique_ptr<NWidgetBase> MakeResizableHeader()
return std::make_unique<NWidgetServerListHeader>(); return std::make_unique<NWidgetServerListHeader>();
} }
/* clang-format off */
static constexpr NWidgetPart _nested_network_game_widgets[] = { static constexpr NWidgetPart _nested_network_game_widgets[] = {
/* TOP */ /* TOP */
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
@ -935,6 +936,7 @@ static constexpr NWidgetPart _nested_network_game_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _network_game_window_desc( static WindowDesc _network_game_window_desc(
WDP_CENTER, "list_servers", 1000, 730, WDP_CENTER, "list_servers", 1000, 730,
@ -1133,6 +1135,7 @@ struct NetworkStartServerWindow : public Window {
} }
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_network_start_server_window_widgets[] = { static constexpr NWidgetPart _nested_network_start_server_window_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_LIGHT_BLUE), NWidget(WWT_CLOSEBOX, COLOUR_LIGHT_BLUE),
@ -1199,6 +1202,7 @@ static constexpr NWidgetPart _nested_network_start_server_window_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _network_start_server_window_desc( static WindowDesc _network_start_server_window_desc(
WDP_CENTER, nullptr, 0, 0, WDP_CENTER, nullptr, 0, 0,
@ -1221,6 +1225,7 @@ static void ShowNetworkStartServerWindow()
extern void DrawCompanyIcon(CompanyID cid, int x, int y); extern void DrawCompanyIcon(CompanyID cid, int x, int y);
/* clang-format off */
static constexpr NWidgetPart _nested_client_list_widgets[] = { static constexpr NWidgetPart _nested_client_list_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -1273,6 +1278,7 @@ static constexpr NWidgetPart _nested_client_list_widgets[] = {
NWidget(WWT_RESIZEBOX, COLOUR_GREY), NWidget(WWT_RESIZEBOX, COLOUR_GREY),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _client_list_desc( static WindowDesc _client_list_desc(
WDP_AUTO, "list_clients", 220, 300, WDP_AUTO, "list_clients", 220, 300,
@ -2145,6 +2151,7 @@ struct NetworkJoinStatusWindow : Window {
} }
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_network_join_status_window_widgets[] = { static constexpr NWidgetPart _nested_network_join_status_window_widgets[] = {
NWidget(WWT_CAPTION, COLOUR_GREY), SetStringTip(STR_NETWORK_CONNECTING_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), NWidget(WWT_CAPTION, COLOUR_GREY), SetStringTip(STR_NETWORK_CONNECTING_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_PANEL, COLOUR_GREY), NWidget(WWT_PANEL, COLOUR_GREY),
@ -2155,6 +2162,7 @@ static constexpr NWidgetPart _nested_network_join_status_window_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _network_join_status_window_desc( static WindowDesc _network_join_status_window_desc(
WDP_CENTER, nullptr, 0, 0, WDP_CENTER, nullptr, 0, 0,
@ -2246,6 +2254,7 @@ struct NetworkAskRelayWindow : public Window {
} }
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_network_ask_relay_widgets[] = { static constexpr NWidgetPart _nested_network_ask_relay_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_RED), NWidget(WWT_CLOSEBOX, COLOUR_RED),
@ -2262,6 +2271,7 @@ static constexpr NWidgetPart _nested_network_ask_relay_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _network_ask_relay_desc( static WindowDesc _network_ask_relay_desc(
WDP_CENTER, nullptr, 0, 0, WDP_CENTER, nullptr, 0, 0,
@ -2341,6 +2351,7 @@ struct NetworkAskSurveyWindow : public Window {
} }
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_network_ask_survey_widgets[] = { static constexpr NWidgetPart _nested_network_ask_survey_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -2360,6 +2371,7 @@ static constexpr NWidgetPart _nested_network_ask_survey_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _network_ask_survey_desc( static WindowDesc _network_ask_survey_desc(
WDP_CENTER, nullptr, 0, 0, WDP_CENTER, nullptr, 0, 0,

View File

@ -638,6 +638,7 @@ struct NewGRFInspectWindow : Window {
/* static */ uint32_t NewGRFInspectWindow::var60params[GSF_FAKE_END][0x20] = { {0} }; // Use spec to have 0s in whole array /* static */ uint32_t NewGRFInspectWindow::var60params[GSF_FAKE_END][0x20] = { {0} }; // Use spec to have 0s in whole array
/* clang-format off */
static constexpr NWidgetPart _nested_newgrf_inspect_chain_widgets[] = { static constexpr NWidgetPart _nested_newgrf_inspect_chain_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -661,7 +662,9 @@ static constexpr NWidgetPart _nested_newgrf_inspect_chain_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/* clang-format off */
static constexpr NWidgetPart _nested_newgrf_inspect_widgets[] = { static constexpr NWidgetPart _nested_newgrf_inspect_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -679,6 +682,7 @@ static constexpr NWidgetPart _nested_newgrf_inspect_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _newgrf_inspect_chain_desc( static WindowDesc _newgrf_inspect_chain_desc(
WDP_AUTO, "newgrf_inspect_chain", 400, 300, WDP_AUTO, "newgrf_inspect_chain", 400, 300,
@ -1132,6 +1136,7 @@ private:
bool SpriteAlignerWindow::centre = true; bool SpriteAlignerWindow::centre = true;
bool SpriteAlignerWindow::crosshair = true; bool SpriteAlignerWindow::crosshair = true;
/* clang-format off */
static constexpr NWidgetPart _nested_sprite_aligner_widgets[] = { static constexpr NWidgetPart _nested_sprite_aligner_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -1201,6 +1206,7 @@ static constexpr NWidgetPart _nested_sprite_aligner_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _sprite_aligner_desc( static WindowDesc _sprite_aligner_desc(
WDP_AUTO, "sprite_aligner", 400, 300, WDP_AUTO, "sprite_aligner", 400, 300,

View File

@ -499,6 +499,7 @@ struct NewGRFParametersWindow : public Window {
GRFParameterInfo NewGRFParametersWindow::dummy_parameter_info(0); GRFParameterInfo NewGRFParametersWindow::dummy_parameter_info(0);
/* clang-format off */
static constexpr NWidgetPart _nested_newgrf_parameter_widgets[] = { static constexpr NWidgetPart _nested_newgrf_parameter_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_MAUVE), NWidget(WWT_CLOSEBOX, COLOUR_MAUVE),
@ -530,6 +531,7 @@ static constexpr NWidgetPart _nested_newgrf_parameter_widgets[] = {
NWidget(WWT_RESIZEBOX, COLOUR_MAUVE), NWidget(WWT_RESIZEBOX, COLOUR_MAUVE),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** Window definition for the change grf parameters window */ /** Window definition for the change grf parameters window */
static WindowDesc _newgrf_parameters_desc( static WindowDesc _newgrf_parameters_desc(
@ -1752,6 +1754,7 @@ public:
const uint NWidgetNewGRFDisplay::MAX_EXTRA_INFO_WIDTH = 150; const uint NWidgetNewGRFDisplay::MAX_EXTRA_INFO_WIDTH = 150;
const uint NWidgetNewGRFDisplay::MIN_EXTRA_FOR_3_COLUMNS = 50; const uint NWidgetNewGRFDisplay::MIN_EXTRA_FOR_3_COLUMNS = 50;
/* clang-format off */
static constexpr NWidgetPart _nested_newgrf_actives_widgets[] = { static constexpr NWidgetPart _nested_newgrf_actives_widgets[] = {
NWidget(NWID_VERTICAL), SetPIP(0, WidgetDimensions::unscaled.vsep_wide, 0), NWidget(NWID_VERTICAL), SetPIP(0, WidgetDimensions::unscaled.vsep_wide, 0),
/* Left side, presets. */ /* Left side, presets. */
@ -1806,7 +1809,9 @@ static constexpr NWidgetPart _nested_newgrf_actives_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/* clang-format off */
static constexpr NWidgetPart _nested_newgrf_availables_widgets[] = { static constexpr NWidgetPart _nested_newgrf_availables_widgets[] = {
NWidget(WWT_FRAME, COLOUR_MAUVE), SetStringTip(STR_NEWGRF_SETTINGS_INACTIVE_LIST), SetPIP(0, WidgetDimensions::unscaled.vsep_wide, 0), NWidget(WWT_FRAME, COLOUR_MAUVE), SetStringTip(STR_NEWGRF_SETTINGS_INACTIVE_LIST), SetPIP(0, WidgetDimensions::unscaled.vsep_wide, 0),
/* Left side, available grfs, filter edit box. */ /* Left side, available grfs, filter edit box. */
@ -1839,7 +1844,9 @@ static constexpr NWidgetPart _nested_newgrf_availables_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/* clang-format off */
static constexpr NWidgetPart _nested_newgrf_infopanel_widgets[] = { static constexpr NWidgetPart _nested_newgrf_infopanel_widgets[] = {
NWidget(NWID_VERTICAL), SetPIP(0, WidgetDimensions::unscaled.vsep_wide, 0), NWidget(NWID_VERTICAL), SetPIP(0, WidgetDimensions::unscaled.vsep_wide, 0),
/* Right side, info panel. */ /* Right side, info panel. */
@ -1881,6 +1888,7 @@ static constexpr NWidgetPart _nested_newgrf_infopanel_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** Construct nested container widget for managing the lists and the info panel of the NewGRF GUI. */ /** Construct nested container widget for managing the lists and the info panel of the NewGRF GUI. */
std::unique_ptr<NWidgetBase> NewGRFDisplay() std::unique_ptr<NWidgetBase> NewGRFDisplay()
@ -1893,6 +1901,7 @@ std::unique_ptr<NWidgetBase> NewGRFDisplay()
} }
/* Widget definition of the manage newgrfs window */ /* Widget definition of the manage newgrfs window */
/* clang-format off */
static constexpr NWidgetPart _nested_newgrf_widgets[] = { static constexpr NWidgetPart _nested_newgrf_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_MAUVE), NWidget(WWT_CLOSEBOX, COLOUR_MAUVE),
@ -1908,6 +1917,7 @@ static constexpr NWidgetPart _nested_newgrf_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/* Window definition of the manage newgrfs window */ /* Window definition of the manage newgrfs window */
static WindowDesc _newgrf_desc( static WindowDesc _newgrf_desc(
@ -1977,6 +1987,7 @@ void ShowNewGRFSettings(bool editable, bool show_params, bool exec_changes, GRFC
} }
/** Widget parts of the save preset window. */ /** Widget parts of the save preset window. */
/* clang-format off */
static constexpr NWidgetPart _nested_save_preset_widgets[] = { static constexpr NWidgetPart _nested_save_preset_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -2000,6 +2011,7 @@ static constexpr NWidgetPart _nested_save_preset_widgets[] = {
NWidget(WWT_RESIZEBOX, COLOUR_GREY), NWidget(WWT_RESIZEBOX, COLOUR_GREY),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** Window description of the preset save window. */ /** Window description of the preset save window. */
static WindowDesc _save_preset_desc( static WindowDesc _save_preset_desc(
@ -2134,6 +2146,7 @@ static void ShowSavePresetWindow(const char *initial_text)
} }
/** Widgets for the progress window. */ /** Widgets for the progress window. */
/* clang-format off */
static constexpr NWidgetPart _nested_scan_progress_widgets[] = { static constexpr NWidgetPart _nested_scan_progress_widgets[] = {
NWidget(WWT_CAPTION, COLOUR_GREY), SetStringTip(STR_NEWGRF_SCAN_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), NWidget(WWT_CAPTION, COLOUR_GREY), SetStringTip(STR_NEWGRF_SCAN_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_PANEL, COLOUR_GREY), NWidget(WWT_PANEL, COLOUR_GREY),
@ -2144,6 +2157,7 @@ static constexpr NWidgetPart _nested_scan_progress_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** Description of the widgets and other settings of the window. */ /** Description of the widgets and other settings of the window. */
static WindowDesc _scan_progress_desc( static WindowDesc _scan_progress_desc(

View File

@ -102,6 +102,7 @@ static TileIndex GetReferenceTile(const NewsReference &reference)
} }
/* Normal news items. */ /* Normal news items. */
/* clang-format off */
static constexpr NWidgetPart _nested_normal_news_widgets[] = { static constexpr NWidgetPart _nested_normal_news_widgets[] = {
NWidget(WWT_PANEL, COLOUR_WHITE, WID_N_PANEL), NWidget(WWT_PANEL, COLOUR_WHITE, WID_N_PANEL),
NWidget(NWID_VERTICAL), SetPadding(WidgetDimensions::unscaled.fullbevel), NWidget(NWID_VERTICAL), SetPadding(WidgetDimensions::unscaled.fullbevel),
@ -125,6 +126,7 @@ static constexpr NWidgetPart _nested_normal_news_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _normal_news_desc( static WindowDesc _normal_news_desc(
WDP_MANUAL, nullptr, 0, 0, WDP_MANUAL, nullptr, 0, 0,
@ -134,6 +136,7 @@ static WindowDesc _normal_news_desc(
); );
/* New vehicles news items. */ /* New vehicles news items. */
/* clang-format off */
static constexpr NWidgetPart _nested_vehicle_news_widgets[] = { static constexpr NWidgetPart _nested_vehicle_news_widgets[] = {
NWidget(WWT_PANEL, COLOUR_WHITE, WID_N_PANEL), NWidget(WWT_PANEL, COLOUR_WHITE, WID_N_PANEL),
NWidget(NWID_VERTICAL), SetPadding(WidgetDimensions::unscaled.fullbevel), NWidget(NWID_VERTICAL), SetPadding(WidgetDimensions::unscaled.fullbevel),
@ -173,6 +176,7 @@ static constexpr NWidgetPart _nested_vehicle_news_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _vehicle_news_desc( static WindowDesc _vehicle_news_desc(
WDP_MANUAL, nullptr, 0, 0, WDP_MANUAL, nullptr, 0, 0,
@ -182,6 +186,7 @@ static WindowDesc _vehicle_news_desc(
); );
/* Company news items. */ /* Company news items. */
/* clang-format off */
static constexpr NWidgetPart _nested_company_news_widgets[] = { static constexpr NWidgetPart _nested_company_news_widgets[] = {
NWidget(WWT_PANEL, COLOUR_WHITE, WID_N_PANEL), NWidget(WWT_PANEL, COLOUR_WHITE, WID_N_PANEL),
NWidget(NWID_VERTICAL), SetPadding(WidgetDimensions::unscaled.fullbevel), NWidget(NWID_VERTICAL), SetPadding(WidgetDimensions::unscaled.fullbevel),
@ -218,6 +223,7 @@ static constexpr NWidgetPart _nested_company_news_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _company_news_desc( static WindowDesc _company_news_desc(
WDP_MANUAL, nullptr, 0, 0, WDP_MANUAL, nullptr, 0, 0,
@ -227,6 +233,7 @@ static WindowDesc _company_news_desc(
); );
/* Thin news items. */ /* Thin news items. */
/* clang-format off */
static constexpr NWidgetPart _nested_thin_news_widgets[] = { static constexpr NWidgetPart _nested_thin_news_widgets[] = {
NWidget(WWT_PANEL, COLOUR_WHITE, WID_N_PANEL), NWidget(WWT_PANEL, COLOUR_WHITE, WID_N_PANEL),
NWidget(NWID_VERTICAL), SetPadding(WidgetDimensions::unscaled.fullbevel), NWidget(NWID_VERTICAL), SetPadding(WidgetDimensions::unscaled.fullbevel),
@ -252,6 +259,7 @@ static constexpr NWidgetPart _nested_thin_news_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _thin_news_desc( static WindowDesc _thin_news_desc(
WDP_MANUAL, nullptr, 0, 0, WDP_MANUAL, nullptr, 0, 0,
@ -261,6 +269,7 @@ static WindowDesc _thin_news_desc(
); );
/* Small news items. */ /* Small news items. */
/* clang-format off */
static constexpr NWidgetPart _nested_small_news_widgets[] = { static constexpr NWidgetPart _nested_small_news_widgets[] = {
/* Caption + close box. The caption is not WWT_CAPTION as the window shall not be moveable and so on. */ /* Caption + close box. The caption is not WWT_CAPTION as the window shall not be moveable and so on. */
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
@ -288,6 +297,7 @@ static constexpr NWidgetPart _nested_small_news_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _small_news_desc( static WindowDesc _small_news_desc(
WDP_MANUAL, nullptr, 0, 0, WDP_MANUAL, nullptr, 0, 0,
@ -1275,6 +1285,7 @@ struct MessageHistoryWindow : Window {
} }
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_message_history[] = { static constexpr NWidgetPart _nested_message_history[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN), NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
@ -1293,6 +1304,7 @@ static constexpr NWidgetPart _nested_message_history[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _message_history_desc( static WindowDesc _message_history_desc(
WDP_AUTO, "list_news", 400, 140, WDP_AUTO, "list_news", 400, 140,

View File

@ -379,6 +379,7 @@ public:
}, BuildObjectGlobalHotkeys}; }, BuildObjectGlobalHotkeys};
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_build_object_widgets[] = { static constexpr NWidgetPart _nested_build_object_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
@ -406,6 +407,7 @@ static constexpr NWidgetPart _nested_build_object_widgets[] = {
NWidgetFunction(MakePickerTypeWidgets), NWidgetFunction(MakePickerTypeWidgets),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _build_object_desc( static WindowDesc _build_object_desc(
WDP_AUTO, "build_object", 0, 0, WDP_AUTO, "build_object", 0, 0,

View File

@ -1596,6 +1596,7 @@ public:
}; };
/** Nested widget definition for "your" train orders. */ /** Nested widget definition for "your" train orders. */
/* clang-format off */
static constexpr NWidgetPart _nested_orders_train_widgets[] = { static constexpr NWidgetPart _nested_orders_train_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -1663,6 +1664,7 @@ static constexpr NWidgetPart _nested_orders_train_widgets[] = {
NWidget(WWT_RESIZEBOX, COLOUR_GREY), NWidget(WWT_RESIZEBOX, COLOUR_GREY),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _orders_train_desc( static WindowDesc _orders_train_desc(
WDP_AUTO, "view_vehicle_orders_train", 384, 100, WDP_AUTO, "view_vehicle_orders_train", 384, 100,
@ -1673,6 +1675,7 @@ static WindowDesc _orders_train_desc(
); );
/** Nested widget definition for "your" orders (non-train). */ /** Nested widget definition for "your" orders (non-train). */
/* clang-format off */
static constexpr NWidgetPart _nested_orders_widgets[] = { static constexpr NWidgetPart _nested_orders_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -1736,6 +1739,7 @@ static constexpr NWidgetPart _nested_orders_widgets[] = {
NWidget(WWT_RESIZEBOX, COLOUR_GREY), NWidget(WWT_RESIZEBOX, COLOUR_GREY),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _orders_desc( static WindowDesc _orders_desc(
WDP_AUTO, "view_vehicle_orders", 384, 100, WDP_AUTO, "view_vehicle_orders", 384, 100,
@ -1746,6 +1750,7 @@ static WindowDesc _orders_desc(
); );
/** Nested widget definition for competitor orders. */ /** Nested widget definition for competitor orders. */
/* clang-format off */
static constexpr NWidgetPart _nested_other_orders_widgets[] = { static constexpr NWidgetPart _nested_other_orders_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -1763,6 +1768,7 @@ static constexpr NWidgetPart _nested_other_orders_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _other_orders_desc( static WindowDesc _other_orders_desc(
WDP_AUTO, "view_vehicle_orders_competitor", 384, 86, WDP_AUTO, "view_vehicle_orders_competitor", 384, 86,

View File

@ -321,6 +321,7 @@ static std::unique_ptr<NWidgetBase> MakeSpacebarKeys()
} }
/* clang-format off */
static constexpr NWidgetPart _nested_osk_widgets[] = { static constexpr NWidgetPart _nested_osk_widgets[] = {
NWidget(WWT_CAPTION, COLOUR_GREY, WID_OSK_CAPTION), SetTextStyle(TC_WHITE), NWidget(WWT_CAPTION, COLOUR_GREY, WID_OSK_CAPTION), SetTextStyle(TC_WHITE),
NWidget(WWT_PANEL, COLOUR_GREY), NWidget(WWT_PANEL, COLOUR_GREY),
@ -337,6 +338,7 @@ static constexpr NWidgetPart _nested_osk_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _osk_desc( static WindowDesc _osk_desc(
WDP_CENTER, nullptr, 0, 0, WDP_CENTER, nullptr, 0, 0,

View File

@ -858,6 +858,7 @@ struct BuildRailToolbarWindow : Window {
}, RailToolbarGlobalHotkeys}; }, RailToolbarGlobalHotkeys};
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_build_rail_widgets[] = { static constexpr NWidgetPart _nested_build_rail_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
@ -898,6 +899,7 @@ static constexpr NWidgetPart _nested_build_rail_widgets[] = {
SetFill(0, 1), SetMinimalSize(22, 22), SetSpriteTip(SPR_IMG_CONVERT_RAIL, STR_RAIL_TOOLBAR_TOOLTIP_CONVERT_RAIL), SetFill(0, 1), SetMinimalSize(22, 22), SetSpriteTip(SPR_IMG_CONVERT_RAIL, STR_RAIL_TOOLBAR_TOOLTIP_CONVERT_RAIL),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _build_rail_desc( static WindowDesc _build_rail_desc(
WDP_ALIGN_TOOLBAR, "toolbar_rail", 0, 0, WDP_ALIGN_TOOLBAR, "toolbar_rail", 0, 0,
@ -1384,6 +1386,7 @@ public:
}, BuildRailStationGlobalHotkeys}; }, BuildRailStationGlobalHotkeys};
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_station_builder_widgets[] = { static constexpr NWidgetPart _nested_station_builder_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
@ -1436,6 +1439,7 @@ static constexpr NWidgetPart _nested_station_builder_widgets[] = {
NWidgetFunction(MakePickerTypeWidgets), NWidgetFunction(MakePickerTypeWidgets),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** High level window description of the station-build window (default & newGRF) */ /** High level window description of the station-build window (default & newGRF) */
static WindowDesc _station_builder_desc( static WindowDesc _station_builder_desc(
@ -1630,6 +1634,7 @@ public:
}; };
/** Nested widget definition of the build signal window */ /** Nested widget definition of the build signal window */
/* clang-format off */
static constexpr NWidgetPart _nested_signal_builder_widgets[] = { static constexpr NWidgetPart _nested_signal_builder_widgets[] = {
/* Title bar and buttons. */ /* Title bar and buttons. */
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
@ -1694,6 +1699,7 @@ static constexpr NWidgetPart _nested_signal_builder_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** Signal selection window description */ /** Signal selection window description */
static WindowDesc _signal_builder_desc( static WindowDesc _signal_builder_desc(
@ -1758,6 +1764,7 @@ struct BuildRailDepotWindow : public PickerWindowBase {
}; };
/** Nested widget definition of the build rail depot window */ /** Nested widget definition of the build rail depot window */
/* clang-format off */
static constexpr NWidgetPart _nested_build_depot_widgets[] = { static constexpr NWidgetPart _nested_build_depot_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
@ -1776,6 +1783,7 @@ static constexpr NWidgetPart _nested_build_depot_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _build_depot_desc( static WindowDesc _build_depot_desc(
WDP_AUTO, nullptr, 0, 0, WDP_AUTO, nullptr, 0, 0,
@ -1883,6 +1891,7 @@ struct BuildRailWaypointWindow : public PickerWindow {
}; };
/** Nested widget definition for the build NewGRF rail waypoint window */ /** Nested widget definition for the build NewGRF rail waypoint window */
/* clang-format off */
static constexpr NWidgetPart _nested_build_waypoint_widgets[] = { static constexpr NWidgetPart _nested_build_waypoint_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
@ -1895,6 +1904,7 @@ static constexpr NWidgetPart _nested_build_waypoint_widgets[] = {
NWidgetFunction(MakePickerTypeWidgets), NWidgetFunction(MakePickerTypeWidgets),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _build_waypoint_desc( static WindowDesc _build_waypoint_desc(
WDP_AUTO, "build_waypoint", 0, 0, WDP_AUTO, "build_waypoint", 0, 0,

View File

@ -899,6 +899,7 @@ struct BuildRoadToolbarWindow : Window {
}, TramToolbarGlobalHotkeys}; }, TramToolbarGlobalHotkeys};
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_build_road_widgets[] = { static constexpr NWidgetPart _nested_build_road_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
@ -935,6 +936,7 @@ static constexpr NWidgetPart _nested_build_road_widgets[] = {
SetFill(0, 1), SetMinimalSize(22, 22), SetSpriteTip(SPR_IMG_CONVERT_ROAD, STR_ROAD_TOOLBAR_TOOLTIP_CONVERT_ROAD), SetFill(0, 1), SetMinimalSize(22, 22), SetSpriteTip(SPR_IMG_CONVERT_ROAD, STR_ROAD_TOOLBAR_TOOLTIP_CONVERT_ROAD),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _build_road_desc( static WindowDesc _build_road_desc(
WDP_ALIGN_TOOLBAR, "toolbar_road", 0, 0, WDP_ALIGN_TOOLBAR, "toolbar_road", 0, 0,
@ -944,6 +946,7 @@ static WindowDesc _build_road_desc(
&BuildRoadToolbarWindow::road_hotkeys &BuildRoadToolbarWindow::road_hotkeys
); );
/* clang-format off */
static constexpr NWidgetPart _nested_build_tramway_widgets[] = { static constexpr NWidgetPart _nested_build_tramway_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
@ -978,6 +981,7 @@ static constexpr NWidgetPart _nested_build_tramway_widgets[] = {
SetFill(0, 1), SetMinimalSize(22, 22), SetSpriteTip(SPR_IMG_CONVERT_ROAD, STR_ROAD_TOOLBAR_TOOLTIP_CONVERT_TRAM), SetFill(0, 1), SetMinimalSize(22, 22), SetSpriteTip(SPR_IMG_CONVERT_ROAD, STR_ROAD_TOOLBAR_TOOLTIP_CONVERT_TRAM),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _build_tramway_desc( static WindowDesc _build_tramway_desc(
WDP_ALIGN_TOOLBAR, "toolbar_tramway", 0, 0, WDP_ALIGN_TOOLBAR, "toolbar_tramway", 0, 0,
@ -1005,6 +1009,7 @@ Window *ShowBuildRoadToolbar(RoadType roadtype)
return AllocateWindowDescFront<BuildRoadToolbarWindow>(RoadTypeIsRoad(_cur_roadtype) ? _build_road_desc : _build_tramway_desc, TRANSPORT_ROAD); return AllocateWindowDescFront<BuildRoadToolbarWindow>(RoadTypeIsRoad(_cur_roadtype) ? _build_road_desc : _build_tramway_desc, TRANSPORT_ROAD);
} }
/* clang-format off */
static constexpr NWidgetPart _nested_build_road_scen_widgets[] = { static constexpr NWidgetPart _nested_build_road_scen_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
@ -1033,6 +1038,7 @@ static constexpr NWidgetPart _nested_build_road_scen_widgets[] = {
SetFill(0, 1), SetMinimalSize(22, 22), SetSpriteTip(SPR_IMG_CONVERT_ROAD, STR_ROAD_TOOLBAR_TOOLTIP_CONVERT_ROAD), SetFill(0, 1), SetMinimalSize(22, 22), SetSpriteTip(SPR_IMG_CONVERT_ROAD, STR_ROAD_TOOLBAR_TOOLTIP_CONVERT_ROAD),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _build_road_scen_desc( static WindowDesc _build_road_scen_desc(
WDP_AUTO, "toolbar_road_scen", 0, 0, WDP_AUTO, "toolbar_road_scen", 0, 0,
@ -1042,6 +1048,7 @@ static WindowDesc _build_road_scen_desc(
&BuildRoadToolbarWindow::road_hotkeys &BuildRoadToolbarWindow::road_hotkeys
); );
/* clang-format off */
static constexpr NWidgetPart _nested_build_tramway_scen_widgets[] = { static constexpr NWidgetPart _nested_build_tramway_scen_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
@ -1068,6 +1075,7 @@ static constexpr NWidgetPart _nested_build_tramway_scen_widgets[] = {
SetFill(0, 1), SetMinimalSize(22, 22), SetSpriteTip(SPR_IMG_CONVERT_ROAD, STR_ROAD_TOOLBAR_TOOLTIP_CONVERT_TRAM), SetFill(0, 1), SetMinimalSize(22, 22), SetSpriteTip(SPR_IMG_CONVERT_ROAD, STR_ROAD_TOOLBAR_TOOLTIP_CONVERT_TRAM),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _build_tramway_scen_desc( static WindowDesc _build_tramway_scen_desc(
WDP_AUTO, "toolbar_tram_scen", 0, 0, WDP_AUTO, "toolbar_tram_scen", 0, 0,
@ -1147,6 +1155,7 @@ struct BuildRoadDepotWindow : public PickerWindowBase {
} }
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_build_road_depot_widgets[] = { static constexpr NWidgetPart _nested_build_road_depot_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
@ -1165,6 +1174,7 @@ static constexpr NWidgetPart _nested_build_road_depot_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _build_road_depot_desc( static WindowDesc _build_road_depot_desc(
WDP_AUTO, nullptr, 0, 0, WDP_AUTO, nullptr, 0, 0,
@ -1505,6 +1515,7 @@ public:
}; };
/** Widget definition of the build road station window */ /** Widget definition of the build road station window */
/* clang-format off */
static constexpr NWidgetPart _nested_road_station_picker_widgets[] = { static constexpr NWidgetPart _nested_road_station_picker_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
@ -1557,6 +1568,7 @@ static constexpr NWidgetPart _nested_road_station_picker_widgets[] = {
NWidgetFunction(MakePickerTypeWidgets), NWidgetFunction(MakePickerTypeWidgets),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _road_station_picker_desc( static WindowDesc _road_station_picker_desc(
WDP_AUTO, "build_station_road", 0, 0, WDP_AUTO, "build_station_road", 0, 0,
@ -1567,6 +1579,7 @@ static WindowDesc _road_station_picker_desc(
); );
/** Widget definition of the build tram station window */ /** Widget definition of the build tram station window */
/* clang-format off */
static constexpr NWidgetPart _nested_tram_station_picker_widgets[] = { static constexpr NWidgetPart _nested_tram_station_picker_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
@ -1597,6 +1610,7 @@ static constexpr NWidgetPart _nested_tram_station_picker_widgets[] = {
NWidgetFunction(MakePickerTypeWidgets), NWidgetFunction(MakePickerTypeWidgets),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _tram_station_picker_desc( static WindowDesc _tram_station_picker_desc(
WDP_AUTO, "build_station_tram", 0, 0, WDP_AUTO, "build_station_tram", 0, 0,
@ -1706,6 +1720,7 @@ struct BuildRoadWaypointWindow : public PickerWindow {
}; };
/** Nested widget definition for the build NewGRF road waypoint window */ /** Nested widget definition for the build NewGRF road waypoint window */
/* clang-format off */
static constexpr NWidgetPart _nested_build_road_waypoint_widgets[] = { static constexpr NWidgetPart _nested_build_road_waypoint_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
@ -1718,6 +1733,7 @@ static constexpr NWidgetPart _nested_build_road_waypoint_widgets[] = {
NWidgetFunction(MakePickerTypeWidgets), NWidgetFunction(MakePickerTypeWidgets),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _build_road_waypoint_desc( static WindowDesc _build_road_waypoint_desc(
WDP_AUTO, "build_road_waypoint", 0, 0, WDP_AUTO, "build_road_waypoint", 0, 0,

View File

@ -47,6 +47,7 @@ struct ScreenshotWindow : Window {
} }
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_screenshot[] = { static constexpr NWidgetPart _nested_screenshot[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -63,6 +64,7 @@ static constexpr NWidgetPart _nested_screenshot[] = {
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_SC_TAKE_MINIMAP), SetFill(1, 1), SetStringTip(STR_SCREENSHOT_MINIMAP_SCREENSHOT), SetMinimalTextLines(2, 0), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_SC_TAKE_MINIMAP), SetFill(1, 1), SetStringTip(STR_SCREENSHOT_MINIMAP_SCREENSHOT), SetMinimalTextLines(2, 0),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _screenshot_window_desc( static WindowDesc _screenshot_window_desc(
WDP_AUTO, "take_a_screenshot", 200, 100, WDP_AUTO, "take_a_screenshot", 200, 100,

View File

@ -247,6 +247,7 @@ struct ScriptListWindow : public Window {
}; };
/** Widgets for the AI list window. */ /** Widgets for the AI list window. */
/* clang-format off */
static constexpr NWidgetPart _nested_script_list_widgets[] = { static constexpr NWidgetPart _nested_script_list_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_MAUVE), NWidget(WWT_CLOSEBOX, COLOUR_MAUVE),
@ -267,6 +268,7 @@ static constexpr NWidgetPart _nested_script_list_widgets[] = {
NWidget(WWT_RESIZEBOX, COLOUR_MAUVE), NWidget(WWT_RESIZEBOX, COLOUR_MAUVE),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** Window definition for the ai list window. */ /** Window definition for the ai list window. */
static WindowDesc _script_list_desc( static WindowDesc _script_list_desc(
@ -565,6 +567,7 @@ private:
}; };
/** Widgets for the Script settings window. */ /** Widgets for the Script settings window. */
/* clang-format off */
static constexpr NWidgetPart _nested_script_settings_widgets[] = { static constexpr NWidgetPart _nested_script_settings_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_MAUVE), NWidget(WWT_CLOSEBOX, COLOUR_MAUVE),
@ -583,6 +586,7 @@ static constexpr NWidgetPart _nested_script_settings_widgets[] = {
NWidget(WWT_RESIZEBOX, COLOUR_MAUVE), NWidget(WWT_RESIZEBOX, COLOUR_MAUVE),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** Window definition for the Script settings window. */ /** Window definition for the Script settings window. */
static WindowDesc _script_settings_desc( static WindowDesc _script_settings_desc(
@ -1211,6 +1215,7 @@ std::unique_ptr<NWidgetBase> MakeCompanyButtonRowsScriptDebug()
} }
/** Widgets for the Script debug window. */ /** Widgets for the Script debug window. */
/* clang-format off */
static constexpr NWidgetPart _nested_script_debug_widgets[] = { static constexpr NWidgetPart _nested_script_debug_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -1257,6 +1262,7 @@ static constexpr NWidgetPart _nested_script_debug_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** Window definition for the Script debug window. */ /** Window definition for the Script debug window. */
static WindowDesc _script_debug_desc( static WindowDesc _script_debug_desc(

View File

@ -192,6 +192,7 @@ static std::optional<std::string> VolumeMarkFunc(int, int mark, int value)
return GetString(STR_GAME_OPTIONS_VOLUME_MARK, value / 31 * 25); return GetString(STR_GAME_OPTIONS_VOLUME_MARK, value / 31 * 25);
} }
/* clang-format off */
static constexpr NWidgetPart _nested_social_plugins_widgets[] = { static constexpr NWidgetPart _nested_social_plugins_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_FRAME, COLOUR_GREY, WID_GO_SOCIAL_PLUGIN_TITLE), NWidget(WWT_FRAME, COLOUR_GREY, WID_GO_SOCIAL_PLUGIN_TITLE),
@ -206,12 +207,15 @@ static constexpr NWidgetPart _nested_social_plugins_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/* clang-format off */
static constexpr NWidgetPart _nested_social_plugins_none_widgets[] = { static constexpr NWidgetPart _nested_social_plugins_none_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_TEXT, INVALID_COLOUR), SetMinimalSize(0, 12), SetFill(1, 0), SetStringTip(STR_GAME_OPTIONS_SOCIAL_PLUGINS_NONE), NWidget(WWT_TEXT, INVALID_COLOUR), SetMinimalSize(0, 12), SetFill(1, 0), SetStringTip(STR_GAME_OPTIONS_SOCIAL_PLUGINS_NONE),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
class NWidgetSocialPlugins : public NWidgetVertical { class NWidgetSocialPlugins : public NWidgetVertical {
public: public:
@ -997,6 +1001,7 @@ struct GameOptionsWindow : Window {
} }
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_game_options_widgets[] = { static constexpr NWidgetPart _nested_game_options_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -1178,6 +1183,7 @@ static constexpr NWidgetPart _nested_game_options_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _game_options_desc( static WindowDesc _game_options_desc(
WDP_CENTER, nullptr, 0, 0, WDP_CENTER, nullptr, 0, 0,
@ -1757,6 +1763,7 @@ struct GameSettingsWindow : Window {
GameSettings *GameSettingsWindow::settings_ptr = nullptr; GameSettings *GameSettingsWindow::settings_ptr = nullptr;
/* clang-format off */
static constexpr NWidgetPart _nested_settings_selection_widgets[] = { static constexpr NWidgetPart _nested_settings_selection_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_MAUVE), NWidget(WWT_CLOSEBOX, COLOUR_MAUVE),
@ -1796,6 +1803,7 @@ static constexpr NWidgetPart _nested_settings_selection_widgets[] = {
NWidget(WWT_RESIZEBOX, COLOUR_MAUVE), NWidget(WWT_RESIZEBOX, COLOUR_MAUVE),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _settings_selection_desc( static WindowDesc _settings_selection_desc(
WDP_CENTER, "settings", 510, 450, WDP_CENTER, "settings", 510, 450,
@ -2062,6 +2070,7 @@ struct CustomCurrencyWindow : Window {
} }
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_cust_currency_widgets[] = { static constexpr NWidgetPart _nested_cust_currency_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -2102,6 +2111,7 @@ static constexpr NWidgetPart _nested_cust_currency_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _cust_currency_desc( static WindowDesc _cust_currency_desc(
WDP_CENTER, nullptr, 0, 0, WDP_CENTER, nullptr, 0, 0,

View File

@ -349,6 +349,7 @@ struct SignListWindow : Window, SignList {
}, SignListGlobalHotkeys}; }, SignListGlobalHotkeys};
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_sign_list_widgets[] = { static constexpr NWidgetPart _nested_sign_list_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN), NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
@ -375,6 +376,7 @@ static constexpr NWidgetPart _nested_sign_list_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _sign_list_desc( static WindowDesc _sign_list_desc(
WDP_AUTO, "list_signs", 358, 138, WDP_AUTO, "list_signs", 358, 138,
@ -524,6 +526,7 @@ struct SignWindow : Window, SignList {
} }
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_query_sign_edit_widgets[] = { static constexpr NWidgetPart _nested_query_sign_edit_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -542,6 +545,7 @@ static constexpr NWidgetPart _nested_query_sign_edit_widgets[] = {
NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, WID_QES_NEXT), SetMinimalSize(11, 12), SetArrowWidgetTypeTip(AWV_INCREASE, STR_EDIT_SIGN_NEXT_SIGN_TOOLTIP), NWidget(WWT_PUSHARROWBTN, COLOUR_GREY, WID_QES_NEXT), SetMinimalSize(11, 12), SetArrowWidgetTypeTip(AWV_INCREASE, STR_EDIT_SIGN_NEXT_SIGN_TOOLTIP),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _query_sign_edit_desc( static WindowDesc _query_sign_edit_desc(
WDP_CENTER, nullptr, 0, 0, WDP_CENTER, nullptr, 0, 0,

View File

@ -1965,13 +1965,16 @@ public:
}; };
/** Widget parts of the smallmap display. */ /** Widget parts of the smallmap display. */
/* clang-format off */
static constexpr NWidgetPart _nested_smallmap_display[] = { static constexpr NWidgetPart _nested_smallmap_display[] = {
NWidget(WWT_PANEL, COLOUR_BROWN, WID_SM_MAP_BORDER), NWidget(WWT_PANEL, COLOUR_BROWN, WID_SM_MAP_BORDER),
NWidget(WWT_INSET, COLOUR_BROWN, WID_SM_MAP), SetMinimalSize(346, 140), SetResize(1, 1), SetPadding(2, 2, 2, 2), EndContainer(), NWidget(WWT_INSET, COLOUR_BROWN, WID_SM_MAP), SetMinimalSize(346, 140), SetResize(1, 1), SetPadding(2, 2, 2, 2), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** Widget parts of the smallmap legend bar + image buttons. */ /** Widget parts of the smallmap legend bar + image buttons. */
/* clang-format off */
static constexpr NWidgetPart _nested_smallmap_bar[] = { static constexpr NWidgetPart _nested_smallmap_bar[] = {
NWidget(WWT_PANEL, COLOUR_BROWN), NWidget(WWT_PANEL, COLOUR_BROWN),
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
@ -2012,6 +2015,7 @@ static constexpr NWidgetPart _nested_smallmap_bar[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static std::unique_ptr<NWidgetBase> SmallMapDisplay() static std::unique_ptr<NWidgetBase> SmallMapDisplay()
{ {
@ -2022,6 +2026,7 @@ static std::unique_ptr<NWidgetBase> SmallMapDisplay()
return map_display; return map_display;
} }
/* clang-format off */
static constexpr NWidgetPart _nested_smallmap_widgets[] = { static constexpr NWidgetPart _nested_smallmap_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN), NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
@ -2053,6 +2058,7 @@ static constexpr NWidgetPart _nested_smallmap_widgets[] = {
NWidget(WWT_RESIZEBOX, COLOUR_BROWN), NWidget(WWT_RESIZEBOX, COLOUR_BROWN),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _smallmap_desc( static WindowDesc _smallmap_desc(
WDP_AUTO, "smallmap", 484, 314, WDP_AUTO, "smallmap", 484, 314,

View File

@ -759,6 +759,7 @@ const std::initializer_list<GUIStationList::SortFunction * const> CompanyStation
&StationRatingMinSorter &StationRatingMinSorter
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_company_stations_widgets[] = { static constexpr NWidgetPart _nested_company_stations_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -791,6 +792,7 @@ static constexpr NWidgetPart _nested_company_stations_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _company_stations_desc( static WindowDesc _company_stations_desc(
WDP_AUTO, "list_stations", 358, 162, WDP_AUTO, "list_stations", 358, 162,
@ -811,6 +813,7 @@ void ShowCompanyStations(CompanyID company)
AllocateWindowDescFront<CompanyStationsWindow>(_company_stations_desc, company); AllocateWindowDescFront<CompanyStationsWindow>(_company_stations_desc, company);
} }
/* clang-format off */
static constexpr NWidgetPart _nested_station_view_widgets[] = { static constexpr NWidgetPart _nested_station_view_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -847,6 +850,7 @@ static constexpr NWidgetPart _nested_station_view_widgets[] = {
NWidget(WWT_RESIZEBOX, COLOUR_GREY), NWidget(WWT_RESIZEBOX, COLOUR_GREY),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** /**
* Draws icons of waiting cargo in the StationView window * Draws icons of waiting cargo in the StationView window
@ -2262,6 +2266,7 @@ static const BaseStation *FindStationsNearby(TileArea ta, bool distant_join)
return nullptr; return nullptr;
} }
/* clang-format off */
static constexpr NWidgetPart _nested_select_station_widgets[] = { static constexpr NWidgetPart _nested_select_station_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
@ -2276,6 +2281,7 @@ static constexpr NWidgetPart _nested_select_station_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** /**
* Window for selecting stations/waypoints to (distant) join to. * Window for selecting stations/waypoints to (distant) join to.

View File

@ -210,6 +210,7 @@ struct StatusBarWindow : Window {
}}; }};
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_main_status_widgets[] = { static constexpr NWidgetPart _nested_main_status_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_PANEL, COLOUR_GREY, WID_S_LEFT), SetMinimalSize(140, 12), EndContainer(), NWidget(WWT_PANEL, COLOUR_GREY, WID_S_LEFT), SetMinimalSize(140, 12), EndContainer(),
@ -217,6 +218,7 @@ static constexpr NWidgetPart _nested_main_status_widgets[] = {
NWidget(WWT_PUSHBTN, COLOUR_GREY, WID_S_RIGHT), SetMinimalSize(140, 12), NWidget(WWT_PUSHBTN, COLOUR_GREY, WID_S_RIGHT), SetMinimalSize(140, 12),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _main_status_desc( static WindowDesc _main_status_desc(
WDP_MANUAL, nullptr, 0, 0, WDP_MANUAL, nullptr, 0, 0,

View File

@ -937,6 +937,7 @@ const std::initializer_list<GUIStoryPageElementList::SortFunction * const> Story
&PageElementOrderSorter, &PageElementOrderSorter,
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_story_book_widgets[] = { static constexpr NWidgetPart _nested_story_book_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN), NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
@ -957,6 +958,7 @@ static constexpr NWidgetPart _nested_story_book_widgets[] = {
NWidget(WWT_RESIZEBOX, COLOUR_BROWN), NWidget(WWT_RESIZEBOX, COLOUR_BROWN),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _story_book_desc( static WindowDesc _story_book_desc(
WDP_AUTO, "view_story", 400, 300, WDP_AUTO, "view_story", 400, 300,

View File

@ -262,6 +262,7 @@ struct SubsidyListWindow : Window {
} }
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_subsidies_list_widgets[] = { static constexpr NWidgetPart _nested_subsidies_list_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN), NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
@ -278,6 +279,7 @@ static constexpr NWidgetPart _nested_subsidies_list_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _subsidies_list_desc( static WindowDesc _subsidies_list_desc(
WDP_AUTO, "list_subsidies", 500, 127, WDP_AUTO, "list_subsidies", 500, 127,

View File

@ -316,6 +316,7 @@ struct TerraformToolbarWindow : Window {
}, TerraformToolbarGlobalHotkeys}; }, TerraformToolbarGlobalHotkeys};
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_terraform_widgets[] = { static constexpr NWidgetPart _nested_terraform_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
@ -346,6 +347,7 @@ static constexpr NWidgetPart _nested_terraform_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _terraform_desc( static WindowDesc _terraform_desc(
WDP_MANUAL, "toolbar_landscape", 0, 0, WDP_MANUAL, "toolbar_landscape", 0, 0,
@ -445,6 +447,7 @@ static const int8_t _multi_terraform_coords[][2] = {
{-28, 0}, {-24, -2}, {-20, -4}, {-16, -6}, {-12, -8}, { -8,-10}, { -4,-12}, { 0,-14}, { 4,-12}, { 8,-10}, { 12, -8}, { 16, -6}, { 20, -4}, { 24, -2}, { 28, 0}, {-28, 0}, {-24, -2}, {-20, -4}, {-16, -6}, {-12, -8}, { -8,-10}, { -4,-12}, { 0,-14}, { 4,-12}, { 8,-10}, { 12, -8}, { 16, -6}, { 20, -4}, { 24, -2}, { 28, 0},
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_scen_edit_land_gen_widgets[] = { static constexpr NWidgetPart _nested_scen_edit_land_gen_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
@ -493,6 +496,7 @@ static constexpr NWidgetPart _nested_scen_edit_land_gen_widgets[] = {
SetFill(1, 0), SetStringTip(STR_TERRAFORM_RESET_LANDSCAPE, STR_TERRAFORM_RESET_LANDSCAPE_TOOLTIP), SetPadding(1, 2, 2, 2), SetFill(1, 0), SetStringTip(STR_TERRAFORM_RESET_LANDSCAPE, STR_TERRAFORM_RESET_LANDSCAPE_TOOLTIP), SetPadding(1, 2, 2, 2),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** /**
* Callback function for the scenario editor 'reset landscape' confirmation window * Callback function for the scenario editor 'reset landscape' confirmation window

View File

@ -40,6 +40,7 @@
#include "safeguards.h" #include "safeguards.h"
/** Widgets for the textfile window. */ /** Widgets for the textfile window. */
/* clang-format off */
static constexpr NWidgetPart _nested_textfile_widgets[] = { static constexpr NWidgetPart _nested_textfile_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_MAUVE), NWidget(WWT_CLOSEBOX, COLOUR_MAUVE),
@ -74,6 +75,7 @@ static constexpr NWidgetPart _nested_textfile_widgets[] = {
NWidget(WWT_RESIZEBOX, COLOUR_MAUVE), NWidget(WWT_RESIZEBOX, COLOUR_MAUVE),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** Window definition for the textfile window */ /** Window definition for the textfile window */
static WindowDesc _textfile_desc( static WindowDesc _textfile_desc(

View File

@ -808,6 +808,7 @@ struct TimetableWindow : Window {
}}; }};
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_timetable_widgets[] = { static constexpr NWidgetPart _nested_timetable_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -853,6 +854,7 @@ static constexpr NWidgetPart _nested_timetable_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _timetable_desc( static WindowDesc _timetable_desc(
WDP_AUTO, "view_vehicle_timetable", 400, 130, WDP_AUTO, "view_vehicle_timetable", 400, 130,

View File

@ -2239,9 +2239,11 @@ static std::unique_ptr<NWidgetBase> MakeMainToolbar()
return hor; return hor;
} }
/* clang-format off */
static constexpr NWidgetPart _nested_toolbar_normal_widgets[] = { static constexpr NWidgetPart _nested_toolbar_normal_widgets[] = {
NWidgetFunction(MakeMainToolbar), NWidgetFunction(MakeMainToolbar),
}; };
/* clang-format on */
static WindowDesc _toolb_normal_desc( static WindowDesc _toolb_normal_desc(
WDP_MANUAL, nullptr, 0, 0, WDP_MANUAL, nullptr, 0, 0,
@ -2540,6 +2542,7 @@ struct ScenarioEditorToolbarWindow : Window {
}}; }};
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_toolb_scen_inner_widgets[] = { static constexpr NWidgetPart _nested_toolb_scen_inner_widgets[] = {
NWidget(WWT_IMGBTN, COLOUR_GREY, WID_TE_PAUSE), SetSpriteTip(SPR_IMG_PAUSE, STR_TOOLBAR_TOOLTIP_PAUSE_GAME), NWidget(WWT_IMGBTN, COLOUR_GREY, WID_TE_PAUSE), SetSpriteTip(SPR_IMG_PAUSE, STR_TOOLBAR_TOOLTIP_PAUSE_GAME),
NWidget(WWT_IMGBTN, COLOUR_GREY, WID_TE_FAST_FORWARD), SetSpriteTip(SPR_IMG_FASTFORWARD, STR_TOOLBAR_TOOLTIP_FORWARD), NWidget(WWT_IMGBTN, COLOUR_GREY, WID_TE_FAST_FORWARD), SetSpriteTip(SPR_IMG_FASTFORWARD, STR_TOOLBAR_TOOLTIP_FORWARD),
@ -2574,15 +2577,18 @@ static constexpr NWidgetPart _nested_toolb_scen_inner_widgets[] = {
NWidget(WWT_IMGBTN, COLOUR_GREY, WID_TE_HELP), SetSpriteTip(SPR_IMG_QUERY, STR_TOOLBAR_TOOLTIP_LAND_BLOCK_INFORMATION), NWidget(WWT_IMGBTN, COLOUR_GREY, WID_TE_HELP), SetSpriteTip(SPR_IMG_QUERY, STR_TOOLBAR_TOOLTIP_LAND_BLOCK_INFORMATION),
NWidget(WWT_IMGBTN, COLOUR_GREY, WID_TE_SWITCH_BAR), SetSpriteTip(SPR_IMG_SWITCH_TOOLBAR, STR_TOOLBAR_TOOLTIP_SWITCH_TOOLBAR), NWidget(WWT_IMGBTN, COLOUR_GREY, WID_TE_SWITCH_BAR), SetSpriteTip(SPR_IMG_SWITCH_TOOLBAR, STR_TOOLBAR_TOOLTIP_SWITCH_TOOLBAR),
}; };
/* clang-format on */
static std::unique_ptr<NWidgetBase> MakeScenarioToolbar() static std::unique_ptr<NWidgetBase> MakeScenarioToolbar()
{ {
return MakeNWidgets(_nested_toolb_scen_inner_widgets, std::make_unique<NWidgetScenarioToolbarContainer>()); return MakeNWidgets(_nested_toolb_scen_inner_widgets, std::make_unique<NWidgetScenarioToolbarContainer>());
} }
/* clang-format off */
static constexpr NWidgetPart _nested_toolb_scen_widgets[] = { static constexpr NWidgetPart _nested_toolb_scen_widgets[] = {
NWidgetFunction(MakeScenarioToolbar), NWidgetFunction(MakeScenarioToolbar),
}; };
/* clang-format on */
static WindowDesc _toolb_scen_desc( static WindowDesc _toolb_scen_desc(
WDP_MANUAL, nullptr, 0, 0, WDP_MANUAL, nullptr, 0, 0,

View File

@ -56,6 +56,7 @@ TownKdtree _town_local_authority_kdtree{};
typedef GUIList<const Town*, const bool &> GUITownList; typedef GUIList<const Town*, const bool &> GUITownList;
/* clang-format off */
static constexpr NWidgetPart _nested_town_authority_widgets[] = { static constexpr NWidgetPart _nested_town_authority_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN), NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
@ -73,6 +74,7 @@ static constexpr NWidgetPart _nested_town_authority_widgets[] = {
NWidget(WWT_RESIZEBOX, COLOUR_BROWN), NWidget(WWT_RESIZEBOX, COLOUR_BROWN),
EndContainer() EndContainer()
}; };
/* clang-format on */
/** Town authority window. */ /** Town authority window. */
struct TownAuthorityWindow : Window { struct TownAuthorityWindow : Window {
@ -610,6 +612,7 @@ public:
}}; }};
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_town_game_view_widgets[] = { static constexpr NWidgetPart _nested_town_game_view_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN), NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
@ -632,6 +635,7 @@ static constexpr NWidgetPart _nested_town_game_view_widgets[] = {
NWidget(WWT_RESIZEBOX, COLOUR_BROWN), NWidget(WWT_RESIZEBOX, COLOUR_BROWN),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _town_game_view_desc( static WindowDesc _town_game_view_desc(
WDP_AUTO, "view_town", 260, TownViewWindow::WID_TV_HEIGHT_NORMAL, WDP_AUTO, "view_town", 260, TownViewWindow::WID_TV_HEIGHT_NORMAL,
@ -640,6 +644,7 @@ static WindowDesc _town_game_view_desc(
_nested_town_game_view_widgets _nested_town_game_view_widgets
); );
/* clang-format off */
static constexpr NWidgetPart _nested_town_editor_view_widgets[] = { static constexpr NWidgetPart _nested_town_editor_view_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN), NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
@ -663,6 +668,7 @@ static constexpr NWidgetPart _nested_town_editor_view_widgets[] = {
NWidget(WWT_RESIZEBOX, COLOUR_BROWN), NWidget(WWT_RESIZEBOX, COLOUR_BROWN),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _town_editor_view_desc( static WindowDesc _town_editor_view_desc(
WDP_AUTO, "view_town_scen", 260, TownViewWindow::WID_TV_HEIGHT_NORMAL, WDP_AUTO, "view_town_scen", 260, TownViewWindow::WID_TV_HEIGHT_NORMAL,
@ -680,6 +686,7 @@ void ShowTownViewWindow(TownID town)
} }
} }
/* clang-format off */
static constexpr NWidgetPart _nested_town_directory_widgets[] = { static constexpr NWidgetPart _nested_town_directory_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_BROWN), NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
@ -707,6 +714,7 @@ static constexpr NWidgetPart _nested_town_directory_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** Enum referring to the Hotkeys in the town directory window */ /** Enum referring to the Hotkeys in the town directory window */
enum TownDirectoryHotkeys : int32_t { enum TownDirectoryHotkeys : int32_t {
@ -1080,6 +1088,7 @@ void CcFoundRandomTown(Commands, const CommandCost &result, Money, TownID town_i
if (result.Succeeded()) ScrollMainWindowToTile(Town::Get(town_id)->xy); if (result.Succeeded()) ScrollMainWindowToTile(Town::Get(town_id)->xy);
} }
/* clang-format off */
static constexpr NWidgetPart _nested_found_town_widgets[] = { static constexpr NWidgetPart _nested_found_town_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
@ -1141,6 +1150,7 @@ static constexpr NWidgetPart _nested_found_town_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** Found a town window class. */ /** Found a town window class. */
struct FoundTownWindow : Window { struct FoundTownWindow : Window {
@ -1818,6 +1828,7 @@ struct BuildHouseWindow : public PickerWindow {
}; };
/** Nested widget definition for the build NewGRF rail waypoint window */ /** Nested widget definition for the build NewGRF rail waypoint window */
/* clang-format off */
static constexpr NWidgetPart _nested_build_house_widgets[] = { static constexpr NWidgetPart _nested_build_house_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
@ -1844,6 +1855,7 @@ static constexpr NWidgetPart _nested_build_house_widgets[] = {
NWidgetFunction(MakePickerTypeWidgets), NWidgetFunction(MakePickerTypeWidgets),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _build_house_desc( static WindowDesc _build_house_desc(
WDP_AUTO, "build_house", 0, 0, WDP_AUTO, "build_house", 0, 0,

View File

@ -126,6 +126,7 @@ public:
} }
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_transparency_widgets[] = { static constexpr NWidgetPart _nested_transparency_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
@ -148,6 +149,7 @@ static constexpr NWidgetPart _nested_transparency_widgets[] = {
NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_TT_BUTTONS), SetMinimalSize(219, 13), SetToolTip(STR_TRANSPARENT_INVISIBLE_TOOLTIP), NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_TT_BUTTONS), SetMinimalSize(219, 13), SetToolTip(STR_TRANSPARENT_INVISIBLE_TOOLTIP),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _transparency_desc( static WindowDesc _transparency_desc(
WDP_MANUAL, "toolbar_transparency", 0, 0, WDP_MANUAL, "toolbar_transparency", 0, 0,

View File

@ -285,6 +285,7 @@ static std::unique_ptr<NWidgetBase> MakeTreeTypeButtons()
return vstack; return vstack;
} }
/* clang-format off */
static constexpr NWidgetPart _nested_build_trees_widgets[] = { static constexpr NWidgetPart _nested_build_trees_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN),
@ -309,6 +310,7 @@ static constexpr NWidgetPart _nested_build_trees_widgets[] = {
EndContainer(), EndContainer(),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _build_trees_desc( static WindowDesc _build_trees_desc(
WDP_AUTO, "build_tree", 0, 0, WDP_AUTO, "build_tree", 0, 0,

View File

@ -1308,6 +1308,7 @@ struct RefitWindow : public Window {
} }
}; };
/* clang-format off */
static constexpr NWidgetPart _nested_vehicle_refit_widgets[] = { static constexpr NWidgetPart _nested_vehicle_refit_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -1333,6 +1334,7 @@ static constexpr NWidgetPart _nested_vehicle_refit_widgets[] = {
NWidget(WWT_RESIZEBOX, COLOUR_GREY), NWidget(WWT_RESIZEBOX, COLOUR_GREY),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static WindowDesc _vehicle_refit_desc( static WindowDesc _vehicle_refit_desc(
WDP_AUTO, "view_vehicle_refit", 240, 174, WDP_AUTO, "view_vehicle_refit", 240, 174,
@ -1594,6 +1596,7 @@ void ChangeVehicleViewWindow(VehicleID from_index, VehicleID to_index)
ChangeVehicleWindow(WC_VEHICLE_TIMETABLE, from_index, to_index); ChangeVehicleWindow(WC_VEHICLE_TIMETABLE, from_index, to_index);
} }
/* clang-format off */
static constexpr NWidgetPart _nested_vehicle_list[] = { static constexpr NWidgetPart _nested_vehicle_list[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -1653,6 +1656,7 @@ static constexpr NWidgetPart _nested_vehicle_list[] = {
NWidget(WWT_RESIZEBOX, COLOUR_GREY), NWidget(WWT_RESIZEBOX, COLOUR_GREY),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
static void DrawSmallOrderList(const Vehicle *v, int left, int right, int y, uint order_arrow_width, VehicleOrderID start) static void DrawSmallOrderList(const Vehicle *v, int left, int right, int y, uint order_arrow_width, VehicleOrderID start)
{ {
@ -2326,6 +2330,7 @@ static_assert(WID_VD_DETAILS_CAPACITY_OF_EACH == WID_VD_DETAILS_CARGO_CARRIED +
static_assert(WID_VD_DETAILS_TOTAL_CARGO == WID_VD_DETAILS_CARGO_CARRIED + TDW_TAB_TOTALS ); static_assert(WID_VD_DETAILS_TOTAL_CARGO == WID_VD_DETAILS_CARGO_CARRIED + TDW_TAB_TOTALS );
/** Vehicle details widgets (other than train). */ /** Vehicle details widgets (other than train). */
/* clang-format off */
static constexpr NWidgetPart _nested_nontrain_vehicle_details_widgets[] = { static constexpr NWidgetPart _nested_nontrain_vehicle_details_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -2347,8 +2352,10 @@ static constexpr NWidgetPart _nested_nontrain_vehicle_details_widgets[] = {
NWidget(WWT_RESIZEBOX, COLOUR_GREY), NWidget(WWT_RESIZEBOX, COLOUR_GREY),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** Train details widgets. */ /** Train details widgets. */
/* clang-format off */
static constexpr NWidgetPart _nested_train_vehicle_details_widgets[] = { static constexpr NWidgetPart _nested_train_vehicle_details_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -2383,6 +2390,7 @@ static constexpr NWidgetPart _nested_train_vehicle_details_widgets[] = {
NWidget(WWT_RESIZEBOX, COLOUR_GREY), NWidget(WWT_RESIZEBOX, COLOUR_GREY),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
extern int GetTrainDetailsWndVScroll(VehicleID veh_id, TrainDetailsWindowTabs det_tab); extern int GetTrainDetailsWndVScroll(VehicleID veh_id, TrainDetailsWindowTabs det_tab);
@ -2822,6 +2830,7 @@ static void ShowVehicleDetailsWindow(const Vehicle *v)
/* Unified vehicle GUI - Vehicle View Window */ /* Unified vehicle GUI - Vehicle View Window */
/** Vehicle view widgets. */ /** Vehicle view widgets. */
/* clang-format off */
static constexpr NWidgetPart _nested_vehicle_view_widgets[] = { static constexpr NWidgetPart _nested_vehicle_view_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -2863,6 +2872,7 @@ static constexpr NWidgetPart _nested_vehicle_view_widgets[] = {
NWidget(WWT_RESIZEBOX, COLOUR_GREY), NWidget(WWT_RESIZEBOX, COLOUR_GREY),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/* Just to make sure, nobody has changed the vehicle type constants, as we are /* Just to make sure, nobody has changed the vehicle type constants, as we are
using them for array indexing in a number of places here. */ using them for array indexing in a number of places here. */

View File

@ -23,6 +23,7 @@
#include "safeguards.h" #include "safeguards.h"
/* Extra Viewport Window Stuff */ /* Extra Viewport Window Stuff */
/* clang-format off */
static constexpr NWidgetPart _nested_extra_viewport_widgets[] = { static constexpr NWidgetPart _nested_extra_viewport_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -49,6 +50,7 @@ static constexpr NWidgetPart _nested_extra_viewport_widgets[] = {
NWidget(WWT_RESIZEBOX, COLOUR_GREY), NWidget(WWT_RESIZEBOX, COLOUR_GREY),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
class ExtraViewportWindow : public Window { class ExtraViewportWindow : public Window {
public: public:

View File

@ -187,6 +187,7 @@ public:
}; };
/** The widgets of the waypoint view. */ /** The widgets of the waypoint view. */
/* clang-format off */
static constexpr NWidgetPart _nested_waypoint_view_widgets[] = { static constexpr NWidgetPart _nested_waypoint_view_widgets[] = {
NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL),
NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CLOSEBOX, COLOUR_GREY),
@ -208,6 +209,7 @@ static constexpr NWidgetPart _nested_waypoint_view_widgets[] = {
NWidget(WWT_RESIZEBOX, COLOUR_GREY), NWidget(WWT_RESIZEBOX, COLOUR_GREY),
EndContainer(), EndContainer(),
}; };
/* clang-format on */
/** The description of the waypoint view. */ /** The description of the waypoint view. */
static WindowDesc _waypoint_view_desc( static WindowDesc _waypoint_view_desc(