diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index 711441c564..8ae3e45448 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -28,6 +28,7 @@ /** Widgets for the configure AI window. */ +/* clang-format off */ static constexpr NWidgetPart _nested_ai_config_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_MAUVE), @@ -81,6 +82,7 @@ static constexpr NWidgetPart _nested_ai_config_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ /** Window definition for the configure AI window. */ static WindowDesc _ai_config_desc( diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index c06dccbf49..b16045b164 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -197,6 +197,7 @@ struct BuildAirToolbarWindow : Window { }, AirportToolbarGlobalHotkeys}; }; +/* clang-format off */ static constexpr NWidgetPart _nested_air_toolbar_widgets[] = { NWidget(NWID_HORIZONTAL), 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), EndContainer(), }; +/* clang-format on */ static WindowDesc _air_toolbar_desc( WDP_ALIGN_TOOLBAR, "toolbar_air", 0, 0, @@ -580,6 +582,7 @@ public: }}; }; +/* clang-format off */ static constexpr NWidgetPart _nested_build_airport_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), @@ -616,6 +619,7 @@ static constexpr NWidgetPart _nested_build_airport_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _build_airport_desc( WDP_AUTO, nullptr, 0, 0, diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp index 506074751d..9164fead99 100644 --- a/src/autoreplace_gui.cpp +++ b/src/autoreplace_gui.cpp @@ -699,6 +699,7 @@ public: } }; +/* clang-format off */ static constexpr NWidgetPart _nested_replace_rail_vehicle_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -755,6 +756,7 @@ static constexpr NWidgetPart _nested_replace_rail_vehicle_widgets[] = { NWidget(WWT_RESIZEBOX, COLOUR_GREY), EndContainer(), }; +/* clang-format on */ static WindowDesc _replace_rail_vehicle_desc( WDP_AUTO, "replace_vehicle_train", 500, 140, @@ -763,6 +765,7 @@ static WindowDesc _replace_rail_vehicle_desc( _nested_replace_rail_vehicle_widgets ); +/* clang-format off */ static constexpr NWidgetPart _nested_replace_road_vehicle_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -813,6 +816,7 @@ static constexpr NWidgetPart _nested_replace_road_vehicle_widgets[] = { NWidget(WWT_RESIZEBOX, COLOUR_GREY), EndContainer(), }; +/* clang-format on */ static WindowDesc _replace_road_vehicle_desc( WDP_AUTO, "replace_vehicle_road", 500, 140, @@ -821,6 +825,7 @@ static WindowDesc _replace_road_vehicle_desc( _nested_replace_road_vehicle_widgets ); +/* clang-format off */ static constexpr NWidgetPart _nested_replace_vehicle_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -867,6 +872,7 @@ static constexpr NWidgetPart _nested_replace_vehicle_widgets[] = { NWidget(WWT_RESIZEBOX, COLOUR_GREY), EndContainer(), }; +/* clang-format on */ static WindowDesc _replace_vehicle_desc( WDP_AUTO, "replace_vehicle", 456, 118, diff --git a/src/bootstrap_gui.cpp b/src/bootstrap_gui.cpp index 44bce54ca8..63f1eb2e8a 100644 --- a/src/bootstrap_gui.cpp +++ b/src/bootstrap_gui.cpp @@ -33,10 +33,12 @@ #include "safeguards.h" /** Widgets for the background window to prevent smearing. */ +/* clang-format off */ static constexpr NWidgetPart _background_widgets[] = { NWidget(WWT_PANEL, COLOUR_DARK_BLUE, WID_BB_BACKGROUND), SetResize(1, 1), EndContainer(), }; +/* clang-format on */ /** * Window description for the background window to prevent smearing. @@ -66,6 +68,7 @@ public: }; /** Nested widgets for the error window. */ +/* clang-format off */ static constexpr NWidgetPart _nested_bootstrap_errmsg_widgets[] = { NWidget(NWID_HORIZONTAL), 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), EndContainer(), }; +/* clang-format on */ /** Window description for the error window. */ static WindowDesc _bootstrap_errmsg_desc( @@ -123,6 +127,7 @@ public: }; /** Nested widgets for the download window. */ +/* clang-format off */ 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_PANEL, COLOUR_GREY), @@ -132,6 +137,7 @@ static constexpr NWidgetPart _nested_bootstrap_download_status_window_widgets[] EndContainer(), EndContainer(), }; +/* clang-format on */ /** Window description for the download window */ 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. */ +/* clang-format off */ static constexpr NWidgetPart _bootstrap_query_widgets[] = { NWidget(NWID_HORIZONTAL), 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), EndContainer(), }; +/* clang-format on */ /** The window description for the query. */ static WindowDesc _bootstrap_query_desc( diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp index acfda71049..e4e818f3d9 100644 --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -309,6 +309,7 @@ const std::initializer_list BuildBridgeWind }; /** Widgets of the bridge gui. */ +/* clang-format off */ static constexpr NWidgetPart _nested_build_bridge_widgets[] = { /* Header */ NWidget(NWID_HORIZONTAL), @@ -335,6 +336,7 @@ static constexpr NWidgetPart _nested_build_bridge_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ /** Window definition for the rail bridge selection window. */ static WindowDesc _build_bridge_desc( diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index f59ec75f33..54a3fd4284 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -57,6 +57,7 @@ uint GetEngineListHeight(VehicleType type) return std::max(GetCharacterHeight(FS_NORMAL) + WidgetDimensions::scaled.matrix.Vertical(), GetVehicleImageCellSize(type, EIT_PURCHASE).height); } +/* clang-format off */ static constexpr NWidgetPart _nested_build_vehicle_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -95,6 +96,7 @@ static constexpr NWidgetPart _nested_build_vehicle_widgets[] = { NWidget(WWT_RESIZEBOX, COLOUR_GREY), EndContainer(), }; +/* clang-format on */ bool _engine_sort_direction; ///< \c false = descending, \c true = ascending. diff --git a/src/cheat_gui.cpp b/src/cheat_gui.cpp index 7583da680b..6d4ded3158 100644 --- a/src/cheat_gui.cpp +++ b/src/cheat_gui.cpp @@ -218,6 +218,7 @@ static const CheatEntry _cheats_ui[] = { static_assert(CHT_NUM_CHEATS == lengthof(_cheats_ui)); /** Widget definitions of the cheat GUI. */ +/* clang-format off */ static constexpr NWidgetPart _nested_cheat_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -232,6 +233,7 @@ static constexpr NWidgetPart _nested_cheat_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ /** GUI for the cheats. */ struct CheatWindow : Window { diff --git a/src/company_gui.cpp b/src/company_gui.cpp index d1394d0e93..e8e7214dd4 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -284,6 +284,7 @@ static void DrawYearColumn(const Rect &r, TimerGameEconomy::Year year, const Exp DrawPrice(sum, r.left, r.right, y, TC_WHITE); } +/* clang-format off */ static constexpr NWidgetPart _nested_company_finances_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -331,6 +332,7 @@ static constexpr NWidgetPart _nested_company_finances_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ /** Window class displaying the company finances. */ struct CompanyFinancesWindow : Window { @@ -1067,6 +1069,7 @@ public: } }; +/* clang-format off */ static constexpr NWidgetPart _nested_select_company_livery_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -1098,6 +1101,7 @@ static constexpr NWidgetPart _nested_select_company_livery_widgets[] = { NWidget(WWT_RESIZEBOX, COLOUR_GREY), EndContainer(), }; +/* clang-format on */ static WindowDesc _select_company_livery_desc( 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 */ +/* clang-format off */ static constexpr NWidgetPart _nested_select_company_manager_face_widgets[] = { NWidget(NWID_HORIZONTAL), 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), EndContainer(), }; +/* clang-format on */ /** Management class for customizing the face of the company manager. */ class SelectCompanyManagerFaceWindow : public Window @@ -1724,6 +1730,7 @@ static void DoSelectCompanyManagerFace(Window *parent) new SelectCompanyManagerFaceWindow(_select_company_manager_face_desc, parent); } +/* clang-format off */ static constexpr NWidgetPart _nested_company_infrastructure_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -1742,6 +1749,7 @@ static constexpr NWidgetPart _nested_company_infrastructure_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ /** * Window with detailed information about the company's infrastructure. @@ -2028,6 +2036,7 @@ static void ShowCompanyInfrastructure(CompanyID company) AllocateWindowDescFront(_company_infrastructure_desc, company); } +/* clang-format off */ static constexpr NWidgetPart _nested_company_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -2103,6 +2112,7 @@ static constexpr NWidgetPart _nested_company_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ /** Strings for the company vehicle counts */ 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. }; +/* clang-format off */ static constexpr NWidgetPart _nested_buy_company_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_LIGHT_BLUE), @@ -2609,6 +2620,7 @@ static constexpr NWidgetPart _nested_buy_company_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _buy_company_desc( WDP_AUTO, nullptr, 0, 0, diff --git a/src/console_gui.cpp b/src/console_gui.cpp index 597f65a939..dadc7138a5 100644 --- a/src/console_gui.cpp +++ b/src/console_gui.cpp @@ -132,9 +132,11 @@ static inline void IConsoleResetHistoryPos() static const char *IConsoleHistoryAdd(const char *cmd); static void IConsoleHistoryNavigate(int direction); +/* clang-format off */ static constexpr NWidgetPart _nested_console_window_widgets[] = { NWidget(WWT_EMPTY, INVALID_COLOUR, WID_C_BACKGROUND), SetResize(1, 1), }; +/* clang-format on */ static WindowDesc _console_window_desc( WDP_MANUAL, nullptr, 0, 0, diff --git a/src/date_gui.cpp b/src/date_gui.cpp index ec451c1986..d5195e6d5c 100644 --- a/src/date_gui.cpp +++ b/src/date_gui.cpp @@ -173,6 +173,7 @@ struct SetDateWindow : Window { }; /** Widgets for the date setting window. */ +/* clang-format off */ static constexpr NWidgetPart _nested_set_date_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_BROWN), @@ -193,6 +194,7 @@ static constexpr NWidgetPart _nested_set_date_widgets[] = { EndContainer(), EndContainer() }; +/* clang-format on */ /** Description of the date setting window. */ static WindowDesc _set_date_desc( diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index ce738a0ad1..e0477f1eac 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -46,6 +46,7 @@ */ /** Nested widget definition for train depots. */ +/* clang-format off */ static constexpr NWidgetPart _nested_train_depot_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -84,6 +85,7 @@ static constexpr NWidgetPart _nested_train_depot_widgets[] = { NWidget(WWT_RESIZEBOX, COLOUR_GREY), EndContainer(), }; +/* clang-format on */ static WindowDesc _train_depot_desc( WDP_AUTO, "depot_train", 362, 123, diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index 2175713df5..e9e1ff51c5 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -333,6 +333,7 @@ struct BuildDocksToolbarWindow : Window { * Nested widget parts of docks toolbar, game version. * Position of #WID_DT_RIVER widget has changed. */ +/* clang-format off */ static constexpr NWidgetPart _nested_build_docks_toolbar_widgets[] = { NWidget(NWID_HORIZONTAL), 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), EndContainer(), }; +/* clang-format on */ static WindowDesc _build_docks_toolbar_desc( WDP_ALIGN_TOOLBAR, "toolbar_water", 0, 0, @@ -378,6 +380,7 @@ Window *ShowBuildDocksToolbar() * Nested widget parts of docks toolbar, scenario editor version. * 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[] = { NWidget(NWID_HORIZONTAL), 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), EndContainer(), }; +/* clang-format on */ /** Window definition for the build docks in scenario editor window. */ static WindowDesc _build_docks_scen_toolbar_desc( @@ -487,6 +491,7 @@ public: }; /** Nested widget parts of a build dock station window. */ +/* clang-format off */ static constexpr NWidgetPart _nested_build_dock_station_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), @@ -505,6 +510,7 @@ static constexpr NWidgetPart _nested_build_dock_station_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _build_dock_station_desc( WDP_AUTO, nullptr, 0, 0, @@ -588,6 +594,7 @@ public: } }; +/* clang-format off */ static constexpr NWidgetPart _nested_build_docks_depot_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), @@ -600,6 +607,7 @@ static constexpr NWidgetPart _nested_build_docks_depot_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _build_docks_depot_desc( WDP_AUTO, nullptr, 0, 0, diff --git a/src/dropdown.cpp b/src/dropdown.cpp index eb2ad63cbb..a61ef2f096 100644 --- a/src/dropdown.cpp +++ b/src/dropdown.cpp @@ -55,6 +55,7 @@ std::unique_ptr MakeDropDownListCheckedItem(bool checked, Stri return std::make_unique(indent, checked, GetString(str), value, masked, shaded); } +/* clang-format off */ static constexpr NWidgetPart _nested_dropdown_menu_widgets[] = { NWidget(NWID_HORIZONTAL), 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(), }; +/* clang-format on */ static WindowDesc _dropdown_desc( WDP_MANUAL, nullptr, 0, 0, diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp index 355b3b3a51..22c72a554e 100644 --- a/src/engine_gui.cpp +++ b/src/engine_gui.cpp @@ -51,6 +51,7 @@ StringID GetEngineCategoryName(EngineID engine) } } +/* clang-format off */ static constexpr NWidgetPart _nested_engine_preview_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_LIGHT_BLUE), @@ -66,6 +67,7 @@ static constexpr NWidgetPart _nested_engine_preview_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ struct EnginePreviewWindow : Window { int vehicle_space = 0; // The space to show the vehicle image diff --git a/src/error_gui.cpp b/src/error_gui.cpp index b9aa748da5..89b70ff44c 100644 --- a/src/error_gui.cpp +++ b/src/error_gui.cpp @@ -33,6 +33,7 @@ #include "safeguards.h" +/* clang-format off */ static constexpr NWidgetPart _nested_errmsg_widgets[] = { NWidget(NWID_HORIZONTAL), 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), EndContainer(), }; +/* clang-format on */ static WindowDesc _errmsg_desc( WDP_MANUAL, nullptr, 0, 0, @@ -50,6 +52,7 @@ static WindowDesc _errmsg_desc( _nested_errmsg_widgets ); +/* clang-format off */ static constexpr NWidgetPart _nested_errmsg_face_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_RED), @@ -62,6 +65,7 @@ static constexpr NWidgetPart _nested_errmsg_face_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _errmsg_face_desc( WDP_MANUAL, nullptr, 0, 0, diff --git a/src/fios_gui.cpp b/src/fios_gui.cpp index 6bf9210eee..1a32323103 100644 --- a/src/fios_gui.cpp +++ b/src/fios_gui.cpp @@ -65,6 +65,7 @@ void LoadCheckData::Clear() } /** Load game/scenario with optional content download */ +/* clang-format off */ static constexpr NWidgetPart _nested_load_dialog_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -126,8 +127,10 @@ static constexpr NWidgetPart _nested_load_dialog_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ /** Load heightmap with content download */ +/* clang-format off */ static constexpr NWidgetPart _nested_load_heightmap_dialog_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -173,8 +176,10 @@ static constexpr NWidgetPart _nested_load_heightmap_dialog_widgets[] = { NWidget(WWT_RESIZEBOX, COLOUR_GREY), EndContainer(), }; +/* clang-format on */ /** Load town data */ +/* clang-format off */ static constexpr NWidgetPart _nested_load_town_data_dialog_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -215,8 +220,10 @@ static constexpr NWidgetPart _nested_load_town_data_dialog_widgets[] = { NWidget(WWT_RESIZEBOX, COLOUR_GREY), EndContainer(), }; +/* clang-format on */ /** Save game/scenario */ +/* clang-format off */ static constexpr NWidgetPart _nested_save_dialog_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -279,6 +286,7 @@ static constexpr NWidgetPart _nested_save_dialog_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ /** Text colours of #DetailedFileType fios entries in the window. */ static const TextColour _fios_colours[] = { diff --git a/src/framerate_gui.cpp b/src/framerate_gui.cpp index 29edcc1559..5349f1cb01 100644 --- a/src/framerate_gui.cpp +++ b/src/framerate_gui.cpp @@ -376,6 +376,7 @@ static const char * GetAIName(int ai_index) } /** @hideinitializer */ +/* clang-format off */ static constexpr NWidgetPart _framerate_window_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -408,6 +409,7 @@ static constexpr NWidgetPart _framerate_window_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ struct FramerateWindow : Window { int num_active = 0; @@ -694,6 +696,7 @@ static WindowDesc _framerate_display_desc( /** @hideinitializer */ +/* clang-format off */ static constexpr NWidgetPart _frametime_graph_window_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -706,6 +709,7 @@ static constexpr NWidgetPart _frametime_graph_window_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ struct FrametimeGraphWindow : Window { int vertical_scale = TIMESTAMP_PRECISION / 10; ///< number of TIMESTAMP_PRECISION units vertically diff --git a/src/game/game_gui.cpp b/src/game/game_gui.cpp index 0fe11b1eba..16dab757bb 100644 --- a/src/game/game_gui.cpp +++ b/src/game/game_gui.cpp @@ -32,6 +32,7 @@ /** Widgets for the configure GS window. */ +/* clang-format off */ static constexpr NWidgetPart _nested_gs_config_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_MAUVE), @@ -73,6 +74,7 @@ static constexpr NWidgetPart _nested_gs_config_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ /** Window definition for the configure GS window. */ static WindowDesc _gs_config_desc( diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp index 854ae3d226..55ce5b890e 100644 --- a/src/genworld_gui.cpp +++ b/src/genworld_gui.cpp @@ -73,6 +73,7 @@ void SetNewLandscapeType(LandscapeType landscape) } /** Widgets of GenerateLandscapeWindow when generating world */ +/* clang-format off */ static constexpr NWidgetPart _nested_generate_landscape_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_BROWN), @@ -195,8 +196,10 @@ static constexpr NWidgetPart _nested_generate_landscape_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ /** Widgets of GenerateLandscapeWindow when loading heightmap */ +/* clang-format off */ static constexpr NWidgetPart _nested_heightmap_load_widgets[] = { /* Window header. */ NWidget(NWID_HORIZONTAL), @@ -312,6 +315,7 @@ static constexpr NWidgetPart _nested_heightmap_load_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static void StartGeneratingLandscape(GenerateLandscapeWindowMode mode) { @@ -1218,6 +1222,7 @@ struct CreateScenarioWindow : public Window } }; +/* clang-format off */ static constexpr NWidgetPart _nested_create_scenario_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_BROWN), @@ -1276,6 +1281,7 @@ static constexpr NWidgetPart _nested_create_scenario_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _create_scenario_desc( WDP_CENTER, nullptr, 0, 0, @@ -1291,6 +1297,7 @@ void ShowCreateScenario() new CreateScenarioWindow(_create_scenario_desc, GLWM_SCENARIO); } +/* clang-format off */ static constexpr NWidgetPart _nested_generate_progress_widgets[] = { NWidget(WWT_CAPTION, COLOUR_GREY), SetStringTip(STR_GENERATION_WORLD, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), NWidget(WWT_PANEL, COLOUR_GREY), @@ -1301,6 +1308,7 @@ static constexpr NWidgetPart _nested_generate_progress_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _generate_progress_desc( diff --git a/src/goal_gui.cpp b/src/goal_gui.cpp index cccb600371..7b86612f36 100644 --- a/src/goal_gui.cpp +++ b/src/goal_gui.cpp @@ -275,6 +275,7 @@ struct GoalListWindow : public Window { }; /** Widgets of the #GoalListWindow. */ +/* clang-format off */ static constexpr NWidgetPart _nested_goals_list_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_BROWN), @@ -296,6 +297,7 @@ static constexpr NWidgetPart _nested_goals_list_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _goals_list_desc( WDP_AUTO, "list_goals", 500, 127, diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp index 011e1d41c2..00e921fc34 100644 --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -129,6 +129,7 @@ static std::unique_ptr MakeNWidgetCompanyLines() return vert; } +/* clang-format off */ static constexpr NWidgetPart _nested_graph_legend_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_BROWN), @@ -140,6 +141,7 @@ static constexpr NWidgetPart _nested_graph_legend_widgets[] = { NWidgetFunction(MakeNWidgetCompanyLines), EndContainer(), }; +/* clang-format on */ static WindowDesc _graph_legend_desc( WDP_AUTO, "graph_legend", 0, 0, @@ -790,6 +792,7 @@ struct OperatingProfitGraphWindow : BaseGraphWindow { } }; +/* clang-format off */ static constexpr NWidgetPart _nested_operating_profit_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_BROWN), @@ -811,6 +814,7 @@ static constexpr NWidgetPart _nested_operating_profit_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _operating_profit_desc( WDP_AUTO, "graph_operating_profit", 0, 0, @@ -847,6 +851,7 @@ struct IncomeGraphWindow : BaseGraphWindow { } }; +/* clang-format off */ static constexpr NWidgetPart _nested_income_graph_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_BROWN), @@ -868,6 +873,7 @@ static constexpr NWidgetPart _nested_income_graph_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _income_graph_desc( WDP_AUTO, "graph_income", 0, 0, @@ -902,6 +908,7 @@ struct DeliveredCargoGraphWindow : BaseGraphWindow { } }; +/* clang-format off */ static constexpr NWidgetPart _nested_delivered_cargo_graph_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_BROWN), @@ -923,6 +930,7 @@ static constexpr NWidgetPart _nested_delivered_cargo_graph_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _delivered_cargo_graph_desc( WDP_AUTO, "graph_delivered_cargo", 0, 0, @@ -963,6 +971,7 @@ struct PerformanceHistoryGraphWindow : BaseGraphWindow { } }; +/* clang-format off */ static constexpr NWidgetPart _nested_performance_history_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_BROWN), @@ -985,6 +994,7 @@ static constexpr NWidgetPart _nested_performance_history_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _performance_history_desc( WDP_AUTO, "graph_performance", 0, 0, @@ -1019,6 +1029,7 @@ struct CompanyValueGraphWindow : BaseGraphWindow { } }; +/* clang-format off */ static constexpr NWidgetPart _nested_company_value_graph_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_BROWN), @@ -1040,6 +1051,7 @@ static constexpr NWidgetPart _nested_company_value_graph_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _company_value_graph_desc( 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[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_BROWN), @@ -1273,6 +1286,7 @@ static constexpr NWidgetPart _nested_cargo_payment_rates_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _cargo_payment_rates_desc( 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[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_BROWN), @@ -1785,6 +1800,7 @@ static constexpr NWidgetPart _nested_industry_production_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _industry_production_desc( WDP_AUTO, "graph_industry_production", 0, 0, @@ -1836,6 +1852,7 @@ std::unique_ptr MakeCompanyButtonRowsGraphGUI() 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[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_BROWN), @@ -1848,6 +1865,7 @@ static constexpr NWidgetPart _nested_performance_rating_detail_widgets[] = { EndContainer(), NWidgetFunction(MakePerformanceDetailPanels), }; +/* clang-format on */ static WindowDesc _performance_rating_detail_desc( WDP_AUTO, "league_details", 0, 0, diff --git a/src/group_gui.cpp b/src/group_gui.cpp index 20eb26180f..12199f1c39 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -38,6 +38,7 @@ #include "safeguards.h" +/* clang-format off */ static constexpr NWidgetPart _nested_group_widgets[] = { NWidget(NWID_HORIZONTAL), // Window header NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -110,6 +111,7 @@ static constexpr NWidgetPart _nested_group_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ /** * Add children to GUI group list to build a hierarchical tree. diff --git a/src/help_gui.cpp b/src/help_gui.cpp index 43493d0897..93a0515031 100644 --- a/src/help_gui.cpp +++ b/src/help_gui.cpp @@ -175,6 +175,7 @@ private: } }; +/* clang-format off */ static constexpr NWidgetPart _nested_helpwin_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), @@ -200,6 +201,7 @@ static constexpr NWidgetPart _nested_helpwin_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _helpwin_desc( WDP_CENTER, nullptr, 0, 0, diff --git a/src/highscore_gui.cpp b/src/highscore_gui.cpp index fc71a31f79..9af3552155 100644 --- a/src/highscore_gui.cpp +++ b/src/highscore_gui.cpp @@ -209,9 +209,11 @@ struct HighScoreWindow : EndGameHighScoreBaseWindow { } }; +/* clang-format off */ static constexpr NWidgetPart _nested_highscore_widgets[] = { NWidget(WWT_PANEL, COLOUR_BROWN, WID_H_BACKGROUND), SetResize(1, 1), EndContainer(), }; +/* clang-format on */ static WindowDesc _highscore_desc( WDP_MANUAL, nullptr, 0, 0, diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 6ef9c2cb5a..f7f7f16c97 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -262,6 +262,7 @@ void CcBuildIndustry(Commands, const CommandCost &result, TileIndex tile, Indust } } +/* clang-format off */ static constexpr NWidgetPart _nested_build_industry_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), @@ -291,6 +292,7 @@ static constexpr NWidgetPart _nested_build_industry_widgets[] = { NWidget(WWT_RESIZEBOX, COLOUR_DARK_GREEN), EndContainer(), }; +/* clang-format on */ /** Window definition of the dynamic place industries gui */ static WindowDesc _build_industry_desc( @@ -1199,6 +1201,7 @@ static void UpdateIndustryProduction(Industry *i) } /** Widget definition of the view industry gui */ +/* clang-format off */ static constexpr NWidgetPart _nested_industry_view_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_CREAM), @@ -1222,6 +1225,7 @@ static constexpr NWidgetPart _nested_industry_view_widgets[] = { NWidget(WWT_RESIZEBOX, COLOUR_CREAM), EndContainer(), }; +/* clang-format on */ /** Window definition of the view industry gui */ static WindowDesc _industry_view_desc( @@ -1237,6 +1241,7 @@ void ShowIndustryViewWindow(IndustryID industry) } /** Widget definition of the industry directory gui */ +/* clang-format off */ static constexpr NWidgetPart _nested_industry_directory_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_BROWN), @@ -1267,6 +1272,7 @@ static constexpr NWidgetPart _nested_industry_directory_widgets[] = { NWidget(WWT_RESIZEBOX, COLOUR_BROWN), EndContainer(), }; +/* clang-format on */ typedef GUIList &> GUIIndustryList; @@ -1943,6 +1949,7 @@ void ShowIndustryDirectory() } /** Widgets of the industry cargoes window. */ +/* clang-format off */ static constexpr NWidgetPart _nested_industry_cargoes_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_BROWN), @@ -1966,6 +1973,7 @@ static constexpr NWidgetPart _nested_industry_cargoes_widgets[] = { NWidget(WWT_RESIZEBOX, COLOUR_BROWN), EndContainer(), }; +/* clang-format on */ /** Window description for the industry cargoes window. */ static WindowDesc _industry_cargoes_desc( diff --git a/src/intro_gui.cpp b/src/intro_gui.cpp index 396fa4efb9..99482cb0df 100644 --- a/src/intro_gui.cpp +++ b/src/intro_gui.cpp @@ -367,6 +367,7 @@ struct SelectGameWindow : public Window { } }; +/* clang-format off */ static constexpr NWidgetPart _nested_select_game_widgets[] = { NWidget(WWT_CAPTION, COLOUR_BROWN), SetStringTip(STR_INTRO_CAPTION), NWidget(WWT_PANEL, COLOUR_BROWN), @@ -445,6 +446,7 @@ static constexpr NWidgetPart _nested_select_game_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _select_game_desc( WDP_CENTER, nullptr, 0, 0, diff --git a/src/league_gui.cpp b/src/league_gui.cpp index 52452e88ef..24162a93b1 100644 --- a/src/league_gui.cpp +++ b/src/league_gui.cpp @@ -181,6 +181,7 @@ public: } }; +/* clang-format off */ static constexpr NWidgetPart _nested_performance_league_widgets[] = { NWidget(NWID_HORIZONTAL), 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()), EndContainer(), }; +/* clang-format on */ static WindowDesc _performance_league_desc( WDP_AUTO, "performance_league", 0, 0, @@ -417,6 +419,7 @@ public: } }; +/* clang-format off */ static constexpr NWidgetPart _nested_script_league_widgets[] = { NWidget(NWID_HORIZONTAL), 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()), EndContainer(), }; +/* clang-format on */ static WindowDesc _script_league_desc( WDP_AUTO, "script_league", 0, 0, diff --git a/src/linkgraph/linkgraph_gui.cpp b/src/linkgraph/linkgraph_gui.cpp index 57ab1dfaf0..95f451db48 100644 --- a/src/linkgraph/linkgraph_gui.cpp +++ b/src/linkgraph/linkgraph_gui.cpp @@ -496,6 +496,7 @@ std::unique_ptr MakeCargoesLegendLinkGraphGUI() } +/* clang-format off */ static constexpr NWidgetPart _nested_linkgraph_legend_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), @@ -525,6 +526,7 @@ static constexpr NWidgetPart _nested_linkgraph_legend_widgets[] = { EndContainer(), EndContainer() }; +/* clang-format on */ static_assert(WID_LGL_SATURATION_LAST - WID_LGL_SATURATION_FIRST == lengthof(LinkGraphOverlay::LINK_COLOURS[0]) - 1); diff --git a/src/main_gui.cpp b/src/main_gui.cpp index 913aa5d64b..04b7b5eaac 100644 --- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -177,9 +177,11 @@ void FixTitleGameZoom(int zoom_adjust) vp.virtual_height = ScaleByZoom(vp.height, vp.zoom); } +/* clang-format off */ static constexpr NWidgetPart _nested_main_window_widgets[] = { NWidget(NWID_VIEWPORT, INVALID_COLOUR, WID_M_VIEWPORT), SetResize(1, 1), }; +/* clang-format on */ enum GlobalHotKeys : int32_t { GHK_QUIT, diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index eefdf37a29..26461ae7ab 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -47,6 +47,7 @@ enum OskActivation : uint8_t { }; +/* clang-format off */ static constexpr NWidgetPart _nested_land_info_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -56,6 +57,7 @@ static constexpr NWidgetPart _nested_land_info_widgets[] = { EndContainer(), NWidget(WWT_PANEL, COLOUR_GREY, WID_LI_BACKGROUND), EndContainer(), }; +/* clang-format on */ static WindowDesc _land_info_desc( WDP_AUTO, nullptr, 0, 0, @@ -319,6 +321,7 @@ void ShowLandInfo(TileIndex tile) new LandInfoWindow(tile); } +/* clang-format off */ static constexpr NWidgetPart _nested_about_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -334,6 +337,7 @@ static constexpr NWidgetPart _nested_about_widgets[] = { NWidget(WWT_LABEL, INVALID_COLOUR, WID_A_COPYRIGHT), EndContainer(), }; +/* clang-format on */ static WindowDesc _about_desc( WDP_CENTER, nullptr, 0, 0, @@ -586,9 +590,11 @@ void HideFillingPercent(TextEffectID *te_id) *te_id = INVALID_TE_ID; } +/* clang-format off */ static constexpr NWidgetPart _nested_tooltips_widgets[] = { NWidget(WWT_EMPTY, INVALID_COLOUR, WID_TT_BACKGROUND), }; +/* clang-format on */ static WindowDesc _tool_tips_desc( 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[] = { NWidget(NWID_HORIZONTAL), 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), EndContainer(), }; +/* clang-format on */ static WindowDesc _query_string_desc( WDP_CENTER, nullptr, 0, 0, @@ -1113,6 +1121,7 @@ struct QueryWindow : public Window { } }; +/* clang-format off */ static constexpr NWidgetPart _nested_query_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_RED), @@ -1128,6 +1137,7 @@ static constexpr NWidgetPart _nested_query_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _query_desc( WDP_CENTER, nullptr, 0, 0, diff --git a/src/music_gui.cpp b/src/music_gui.cpp index d882cedde4..a00b03781c 100644 --- a/src/music_gui.cpp +++ b/src/music_gui.cpp @@ -623,6 +623,7 @@ struct MusicTrackSelectionWindow : public Window { } }; +/* clang-format off */ static constexpr NWidgetPart _nested_music_track_selection_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -659,6 +660,7 @@ static constexpr NWidgetPart _nested_music_track_selection_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _music_track_selection_desc( WDP_AUTO, nullptr, 0, 0, @@ -855,6 +857,7 @@ struct MusicWindow : public Window { } }; +/* clang-format off */ static constexpr NWidgetPart _nested_music_window_widgets[] = { NWidget(NWID_HORIZONTAL), 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), EndContainer(), }; +/* clang-format on */ static WindowDesc _music_window_desc( WDP_AUTO, "music", 0, 0, diff --git a/src/network/network_chat_gui.cpp b/src/network/network_chat_gui.cpp index cfb8b60d2f..aa3c92f18e 100644 --- a/src/network/network_chat_gui.cpp +++ b/src/network/network_chat_gui.cpp @@ -411,6 +411,7 @@ struct NetworkChatWindow : public Window { }; /** The widgets of the chat window. */ +/* clang-format off */ static constexpr NWidgetPart _nested_chat_window_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY, WID_NC_CLOSE), @@ -424,6 +425,7 @@ static constexpr NWidgetPart _nested_chat_window_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ /** The description of the chat window. */ static WindowDesc _chat_window_desc( diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index a782d5aa48..4bcfe4a6f2 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -86,6 +86,7 @@ void ShowContentTextfileWindow(TextfileType file_type, const ContentInfo *ci) } /** Nested widgets for the download window. */ +/* clang-format off */ 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_PANEL, COLOUR_GREY), @@ -96,6 +97,7 @@ static constexpr NWidgetPart _nested_network_content_download_status_window_widg EndContainer(), EndContainer(), }; +/* clang-format on */ /** Window description for the download window */ static WindowDesc _network_content_download_status_window_desc( @@ -1019,6 +1021,7 @@ void BuildContentTypeStringList() } /** The widgets for the content list. */ +/* clang-format off */ static constexpr NWidgetPart _nested_network_content_list_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_LIGHT_BLUE), @@ -1096,6 +1099,7 @@ static constexpr NWidgetPart _nested_network_content_list_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ /** Window description of the content list */ static WindowDesc _network_content_list_desc( diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 4f1c8b59b9..0d88cc8a2c 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -858,6 +858,7 @@ static std::unique_ptr MakeResizableHeader() return std::make_unique(); } +/* clang-format off */ static constexpr NWidgetPart _nested_network_game_widgets[] = { /* TOP */ NWidget(NWID_HORIZONTAL), @@ -935,6 +936,7 @@ static constexpr NWidgetPart _nested_network_game_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _network_game_window_desc( 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[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_LIGHT_BLUE), @@ -1199,6 +1202,7 @@ static constexpr NWidgetPart _nested_network_start_server_window_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _network_start_server_window_desc( WDP_CENTER, nullptr, 0, 0, @@ -1221,6 +1225,7 @@ static void ShowNetworkStartServerWindow() extern void DrawCompanyIcon(CompanyID cid, int x, int y); +/* clang-format off */ static constexpr NWidgetPart _nested_client_list_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -1273,6 +1278,7 @@ static constexpr NWidgetPart _nested_client_list_widgets[] = { NWidget(WWT_RESIZEBOX, COLOUR_GREY), EndContainer(), }; +/* clang-format on */ static WindowDesc _client_list_desc( 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[] = { NWidget(WWT_CAPTION, COLOUR_GREY), SetStringTip(STR_NETWORK_CONNECTING_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), NWidget(WWT_PANEL, COLOUR_GREY), @@ -2155,6 +2162,7 @@ static constexpr NWidgetPart _nested_network_join_status_window_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _network_join_status_window_desc( WDP_CENTER, nullptr, 0, 0, @@ -2246,6 +2254,7 @@ struct NetworkAskRelayWindow : public Window { } }; +/* clang-format off */ static constexpr NWidgetPart _nested_network_ask_relay_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_RED), @@ -2262,6 +2271,7 @@ static constexpr NWidgetPart _nested_network_ask_relay_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _network_ask_relay_desc( WDP_CENTER, nullptr, 0, 0, @@ -2341,6 +2351,7 @@ struct NetworkAskSurveyWindow : public Window { } }; +/* clang-format off */ static constexpr NWidgetPart _nested_network_ask_survey_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -2360,6 +2371,7 @@ static constexpr NWidgetPart _nested_network_ask_survey_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _network_ask_survey_desc( WDP_CENTER, nullptr, 0, 0, diff --git a/src/newgrf_debug_gui.cpp b/src/newgrf_debug_gui.cpp index 1f83160969..189206a342 100644 --- a/src/newgrf_debug_gui.cpp +++ b/src/newgrf_debug_gui.cpp @@ -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 +/* clang-format off */ static constexpr NWidgetPart _nested_newgrf_inspect_chain_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -661,7 +662,9 @@ static constexpr NWidgetPart _nested_newgrf_inspect_chain_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ +/* clang-format off */ static constexpr NWidgetPart _nested_newgrf_inspect_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -679,6 +682,7 @@ static constexpr NWidgetPart _nested_newgrf_inspect_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _newgrf_inspect_chain_desc( WDP_AUTO, "newgrf_inspect_chain", 400, 300, @@ -1132,6 +1136,7 @@ private: bool SpriteAlignerWindow::centre = true; bool SpriteAlignerWindow::crosshair = true; +/* clang-format off */ static constexpr NWidgetPart _nested_sprite_aligner_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -1201,6 +1206,7 @@ static constexpr NWidgetPart _nested_sprite_aligner_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _sprite_aligner_desc( WDP_AUTO, "sprite_aligner", 400, 300, diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index e074163fba..cfffb3c875 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -499,6 +499,7 @@ struct NewGRFParametersWindow : public Window { GRFParameterInfo NewGRFParametersWindow::dummy_parameter_info(0); +/* clang-format off */ static constexpr NWidgetPart _nested_newgrf_parameter_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_MAUVE), @@ -530,6 +531,7 @@ static constexpr NWidgetPart _nested_newgrf_parameter_widgets[] = { NWidget(WWT_RESIZEBOX, COLOUR_MAUVE), EndContainer(), }; +/* clang-format on */ /** Window definition for the change grf parameters window */ static WindowDesc _newgrf_parameters_desc( @@ -1752,6 +1754,7 @@ public: const uint NWidgetNewGRFDisplay::MAX_EXTRA_INFO_WIDTH = 150; const uint NWidgetNewGRFDisplay::MIN_EXTRA_FOR_3_COLUMNS = 50; +/* clang-format off */ static constexpr NWidgetPart _nested_newgrf_actives_widgets[] = { NWidget(NWID_VERTICAL), SetPIP(0, WidgetDimensions::unscaled.vsep_wide, 0), /* Left side, presets. */ @@ -1806,7 +1809,9 @@ static constexpr NWidgetPart _nested_newgrf_actives_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ +/* clang-format off */ 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), /* Left side, available grfs, filter edit box. */ @@ -1839,7 +1844,9 @@ static constexpr NWidgetPart _nested_newgrf_availables_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ +/* clang-format off */ static constexpr NWidgetPart _nested_newgrf_infopanel_widgets[] = { NWidget(NWID_VERTICAL), SetPIP(0, WidgetDimensions::unscaled.vsep_wide, 0), /* Right side, info panel. */ @@ -1881,6 +1888,7 @@ static constexpr NWidgetPart _nested_newgrf_infopanel_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ /** Construct nested container widget for managing the lists and the info panel of the NewGRF GUI. */ std::unique_ptr NewGRFDisplay() @@ -1893,6 +1901,7 @@ std::unique_ptr NewGRFDisplay() } /* Widget definition of the manage newgrfs window */ +/* clang-format off */ static constexpr NWidgetPart _nested_newgrf_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_MAUVE), @@ -1908,6 +1917,7 @@ static constexpr NWidgetPart _nested_newgrf_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ /* Window definition of the manage newgrfs window */ 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. */ +/* clang-format off */ static constexpr NWidgetPart _nested_save_preset_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -2000,6 +2011,7 @@ static constexpr NWidgetPart _nested_save_preset_widgets[] = { NWidget(WWT_RESIZEBOX, COLOUR_GREY), EndContainer(), }; +/* clang-format on */ /** Window description of the preset save window. */ static WindowDesc _save_preset_desc( @@ -2134,6 +2146,7 @@ static void ShowSavePresetWindow(const char *initial_text) } /** Widgets for the progress window. */ +/* clang-format off */ 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_PANEL, COLOUR_GREY), @@ -2144,6 +2157,7 @@ static constexpr NWidgetPart _nested_scan_progress_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ /** Description of the widgets and other settings of the window. */ static WindowDesc _scan_progress_desc( diff --git a/src/news_gui.cpp b/src/news_gui.cpp index 8445579b74..bb8c0f055e 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -102,6 +102,7 @@ static TileIndex GetReferenceTile(const NewsReference &reference) } /* Normal news items. */ +/* clang-format off */ static constexpr NWidgetPart _nested_normal_news_widgets[] = { NWidget(WWT_PANEL, COLOUR_WHITE, WID_N_PANEL), NWidget(NWID_VERTICAL), SetPadding(WidgetDimensions::unscaled.fullbevel), @@ -125,6 +126,7 @@ static constexpr NWidgetPart _nested_normal_news_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _normal_news_desc( WDP_MANUAL, nullptr, 0, 0, @@ -134,6 +136,7 @@ static WindowDesc _normal_news_desc( ); /* New vehicles news items. */ +/* clang-format off */ static constexpr NWidgetPart _nested_vehicle_news_widgets[] = { NWidget(WWT_PANEL, COLOUR_WHITE, WID_N_PANEL), NWidget(NWID_VERTICAL), SetPadding(WidgetDimensions::unscaled.fullbevel), @@ -173,6 +176,7 @@ static constexpr NWidgetPart _nested_vehicle_news_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _vehicle_news_desc( WDP_MANUAL, nullptr, 0, 0, @@ -182,6 +186,7 @@ static WindowDesc _vehicle_news_desc( ); /* Company news items. */ +/* clang-format off */ static constexpr NWidgetPart _nested_company_news_widgets[] = { NWidget(WWT_PANEL, COLOUR_WHITE, WID_N_PANEL), NWidget(NWID_VERTICAL), SetPadding(WidgetDimensions::unscaled.fullbevel), @@ -218,6 +223,7 @@ static constexpr NWidgetPart _nested_company_news_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _company_news_desc( WDP_MANUAL, nullptr, 0, 0, @@ -227,6 +233,7 @@ static WindowDesc _company_news_desc( ); /* Thin news items. */ +/* clang-format off */ static constexpr NWidgetPart _nested_thin_news_widgets[] = { NWidget(WWT_PANEL, COLOUR_WHITE, WID_N_PANEL), NWidget(NWID_VERTICAL), SetPadding(WidgetDimensions::unscaled.fullbevel), @@ -252,6 +259,7 @@ static constexpr NWidgetPart _nested_thin_news_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _thin_news_desc( WDP_MANUAL, nullptr, 0, 0, @@ -261,6 +269,7 @@ static WindowDesc _thin_news_desc( ); /* Small news items. */ +/* clang-format off */ 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. */ NWidget(NWID_HORIZONTAL), @@ -288,6 +297,7 @@ static constexpr NWidgetPart _nested_small_news_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _small_news_desc( WDP_MANUAL, nullptr, 0, 0, @@ -1275,6 +1285,7 @@ struct MessageHistoryWindow : Window { } }; +/* clang-format off */ static constexpr NWidgetPart _nested_message_history[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_BROWN), @@ -1293,6 +1304,7 @@ static constexpr NWidgetPart _nested_message_history[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _message_history_desc( WDP_AUTO, "list_news", 400, 140, diff --git a/src/object_gui.cpp b/src/object_gui.cpp index b09ced2f23..cc46d24496 100644 --- a/src/object_gui.cpp +++ b/src/object_gui.cpp @@ -379,6 +379,7 @@ public: }, BuildObjectGlobalHotkeys}; }; +/* clang-format off */ static constexpr NWidgetPart _nested_build_object_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), @@ -406,6 +407,7 @@ static constexpr NWidgetPart _nested_build_object_widgets[] = { NWidgetFunction(MakePickerTypeWidgets), EndContainer(), }; +/* clang-format on */ static WindowDesc _build_object_desc( WDP_AUTO, "build_object", 0, 0, diff --git a/src/order_gui.cpp b/src/order_gui.cpp index a3a285ca35..744dc5a47f 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -1596,6 +1596,7 @@ public: }; /** Nested widget definition for "your" train orders. */ +/* clang-format off */ static constexpr NWidgetPart _nested_orders_train_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -1663,6 +1664,7 @@ static constexpr NWidgetPart _nested_orders_train_widgets[] = { NWidget(WWT_RESIZEBOX, COLOUR_GREY), EndContainer(), }; +/* clang-format on */ static WindowDesc _orders_train_desc( 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). */ +/* clang-format off */ static constexpr NWidgetPart _nested_orders_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -1736,6 +1739,7 @@ static constexpr NWidgetPart _nested_orders_widgets[] = { NWidget(WWT_RESIZEBOX, COLOUR_GREY), EndContainer(), }; +/* clang-format on */ static WindowDesc _orders_desc( WDP_AUTO, "view_vehicle_orders", 384, 100, @@ -1746,6 +1750,7 @@ static WindowDesc _orders_desc( ); /** Nested widget definition for competitor orders. */ +/* clang-format off */ static constexpr NWidgetPart _nested_other_orders_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -1763,6 +1768,7 @@ static constexpr NWidgetPart _nested_other_orders_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _other_orders_desc( WDP_AUTO, "view_vehicle_orders_competitor", 384, 86, diff --git a/src/osk_gui.cpp b/src/osk_gui.cpp index 585c267f9f..68ea00323d 100644 --- a/src/osk_gui.cpp +++ b/src/osk_gui.cpp @@ -321,6 +321,7 @@ static std::unique_ptr MakeSpacebarKeys() } +/* clang-format off */ static constexpr NWidgetPart _nested_osk_widgets[] = { NWidget(WWT_CAPTION, COLOUR_GREY, WID_OSK_CAPTION), SetTextStyle(TC_WHITE), NWidget(WWT_PANEL, COLOUR_GREY), @@ -337,6 +338,7 @@ static constexpr NWidgetPart _nested_osk_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _osk_desc( WDP_CENTER, nullptr, 0, 0, diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 118e70442b..1deab9d59e 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -858,6 +858,7 @@ struct BuildRailToolbarWindow : Window { }, RailToolbarGlobalHotkeys}; }; +/* clang-format off */ static constexpr NWidgetPart _nested_build_rail_widgets[] = { NWidget(NWID_HORIZONTAL), 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), EndContainer(), }; +/* clang-format on */ static WindowDesc _build_rail_desc( WDP_ALIGN_TOOLBAR, "toolbar_rail", 0, 0, @@ -1384,6 +1386,7 @@ public: }, BuildRailStationGlobalHotkeys}; }; +/* clang-format off */ static constexpr NWidgetPart _nested_station_builder_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), @@ -1436,6 +1439,7 @@ static constexpr NWidgetPart _nested_station_builder_widgets[] = { NWidgetFunction(MakePickerTypeWidgets), EndContainer(), }; +/* clang-format on */ /** High level window description of the station-build window (default & newGRF) */ static WindowDesc _station_builder_desc( @@ -1630,6 +1634,7 @@ public: }; /** Nested widget definition of the build signal window */ +/* clang-format off */ static constexpr NWidgetPart _nested_signal_builder_widgets[] = { /* Title bar and buttons. */ NWidget(NWID_HORIZONTAL), @@ -1694,6 +1699,7 @@ static constexpr NWidgetPart _nested_signal_builder_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ /** Signal selection window description */ static WindowDesc _signal_builder_desc( @@ -1758,6 +1764,7 @@ struct BuildRailDepotWindow : public PickerWindowBase { }; /** Nested widget definition of the build rail depot window */ +/* clang-format off */ static constexpr NWidgetPart _nested_build_depot_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), @@ -1776,6 +1783,7 @@ static constexpr NWidgetPart _nested_build_depot_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _build_depot_desc( WDP_AUTO, nullptr, 0, 0, @@ -1883,6 +1891,7 @@ struct BuildRailWaypointWindow : public PickerWindow { }; /** Nested widget definition for the build NewGRF rail waypoint window */ +/* clang-format off */ static constexpr NWidgetPart _nested_build_waypoint_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), @@ -1895,6 +1904,7 @@ static constexpr NWidgetPart _nested_build_waypoint_widgets[] = { NWidgetFunction(MakePickerTypeWidgets), EndContainer(), }; +/* clang-format on */ static WindowDesc _build_waypoint_desc( WDP_AUTO, "build_waypoint", 0, 0, diff --git a/src/road_gui.cpp b/src/road_gui.cpp index 904a4e35b0..68698d99d0 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -899,6 +899,7 @@ struct BuildRoadToolbarWindow : Window { }, TramToolbarGlobalHotkeys}; }; +/* clang-format off */ static constexpr NWidgetPart _nested_build_road_widgets[] = { NWidget(NWID_HORIZONTAL), 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), EndContainer(), }; +/* clang-format on */ static WindowDesc _build_road_desc( WDP_ALIGN_TOOLBAR, "toolbar_road", 0, 0, @@ -944,6 +946,7 @@ static WindowDesc _build_road_desc( &BuildRoadToolbarWindow::road_hotkeys ); +/* clang-format off */ static constexpr NWidgetPart _nested_build_tramway_widgets[] = { NWidget(NWID_HORIZONTAL), 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), EndContainer(), }; +/* clang-format on */ static WindowDesc _build_tramway_desc( WDP_ALIGN_TOOLBAR, "toolbar_tramway", 0, 0, @@ -1005,6 +1009,7 @@ Window *ShowBuildRoadToolbar(RoadType roadtype) return AllocateWindowDescFront(RoadTypeIsRoad(_cur_roadtype) ? _build_road_desc : _build_tramway_desc, TRANSPORT_ROAD); } +/* clang-format off */ static constexpr NWidgetPart _nested_build_road_scen_widgets[] = { NWidget(NWID_HORIZONTAL), 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), EndContainer(), }; +/* clang-format on */ static WindowDesc _build_road_scen_desc( WDP_AUTO, "toolbar_road_scen", 0, 0, @@ -1042,6 +1048,7 @@ static WindowDesc _build_road_scen_desc( &BuildRoadToolbarWindow::road_hotkeys ); +/* clang-format off */ static constexpr NWidgetPart _nested_build_tramway_scen_widgets[] = { NWidget(NWID_HORIZONTAL), 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), EndContainer(), }; +/* clang-format on */ static WindowDesc _build_tramway_scen_desc( 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[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), @@ -1165,6 +1174,7 @@ static constexpr NWidgetPart _nested_build_road_depot_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _build_road_depot_desc( WDP_AUTO, nullptr, 0, 0, @@ -1505,6 +1515,7 @@ public: }; /** Widget definition of the build road station window */ +/* clang-format off */ static constexpr NWidgetPart _nested_road_station_picker_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), @@ -1557,6 +1568,7 @@ static constexpr NWidgetPart _nested_road_station_picker_widgets[] = { NWidgetFunction(MakePickerTypeWidgets), EndContainer(), }; +/* clang-format on */ static WindowDesc _road_station_picker_desc( 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 */ +/* clang-format off */ static constexpr NWidgetPart _nested_tram_station_picker_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), @@ -1597,6 +1610,7 @@ static constexpr NWidgetPart _nested_tram_station_picker_widgets[] = { NWidgetFunction(MakePickerTypeWidgets), EndContainer(), }; +/* clang-format on */ static WindowDesc _tram_station_picker_desc( 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 */ +/* clang-format off */ static constexpr NWidgetPart _nested_build_road_waypoint_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), @@ -1718,6 +1733,7 @@ static constexpr NWidgetPart _nested_build_road_waypoint_widgets[] = { NWidgetFunction(MakePickerTypeWidgets), EndContainer(), }; +/* clang-format on */ static WindowDesc _build_road_waypoint_desc( WDP_AUTO, "build_road_waypoint", 0, 0, diff --git a/src/screenshot_gui.cpp b/src/screenshot_gui.cpp index 49a2d73c48..2c238e44b6 100644 --- a/src/screenshot_gui.cpp +++ b/src/screenshot_gui.cpp @@ -47,6 +47,7 @@ struct ScreenshotWindow : Window { } }; +/* clang-format off */ static constexpr NWidgetPart _nested_screenshot[] = { NWidget(NWID_HORIZONTAL), 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), EndContainer(), }; +/* clang-format on */ static WindowDesc _screenshot_window_desc( WDP_AUTO, "take_a_screenshot", 200, 100, diff --git a/src/script/script_gui.cpp b/src/script/script_gui.cpp index c2f4a02a74..93bb8e7bfb 100644 --- a/src/script/script_gui.cpp +++ b/src/script/script_gui.cpp @@ -247,6 +247,7 @@ struct ScriptListWindow : public Window { }; /** Widgets for the AI list window. */ +/* clang-format off */ static constexpr NWidgetPart _nested_script_list_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_MAUVE), @@ -267,6 +268,7 @@ static constexpr NWidgetPart _nested_script_list_widgets[] = { NWidget(WWT_RESIZEBOX, COLOUR_MAUVE), EndContainer(), }; +/* clang-format on */ /** Window definition for the ai list window. */ static WindowDesc _script_list_desc( @@ -565,6 +567,7 @@ private: }; /** Widgets for the Script settings window. */ +/* clang-format off */ static constexpr NWidgetPart _nested_script_settings_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_MAUVE), @@ -583,6 +586,7 @@ static constexpr NWidgetPart _nested_script_settings_widgets[] = { NWidget(WWT_RESIZEBOX, COLOUR_MAUVE), EndContainer(), }; +/* clang-format on */ /** Window definition for the Script settings window. */ static WindowDesc _script_settings_desc( @@ -1211,6 +1215,7 @@ std::unique_ptr MakeCompanyButtonRowsScriptDebug() } /** Widgets for the Script debug window. */ +/* clang-format off */ static constexpr NWidgetPart _nested_script_debug_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -1257,6 +1262,7 @@ static constexpr NWidgetPart _nested_script_debug_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ /** Window definition for the Script debug window. */ static WindowDesc _script_debug_desc( diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 918646af4a..507e0a354f 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -192,6 +192,7 @@ static std::optional VolumeMarkFunc(int, int mark, int value) return GetString(STR_GAME_OPTIONS_VOLUME_MARK, value / 31 * 25); } +/* clang-format off */ static constexpr NWidgetPart _nested_social_plugins_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_FRAME, COLOUR_GREY, WID_GO_SOCIAL_PLUGIN_TITLE), @@ -206,12 +207,15 @@ static constexpr NWidgetPart _nested_social_plugins_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ +/* clang-format off */ static constexpr NWidgetPart _nested_social_plugins_none_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_TEXT, INVALID_COLOUR), SetMinimalSize(0, 12), SetFill(1, 0), SetStringTip(STR_GAME_OPTIONS_SOCIAL_PLUGINS_NONE), EndContainer(), }; +/* clang-format on */ class NWidgetSocialPlugins : public NWidgetVertical { public: @@ -997,6 +1001,7 @@ struct GameOptionsWindow : Window { } }; +/* clang-format off */ static constexpr NWidgetPart _nested_game_options_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -1178,6 +1183,7 @@ static constexpr NWidgetPart _nested_game_options_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _game_options_desc( WDP_CENTER, nullptr, 0, 0, @@ -1757,6 +1763,7 @@ struct GameSettingsWindow : Window { GameSettings *GameSettingsWindow::settings_ptr = nullptr; +/* clang-format off */ static constexpr NWidgetPart _nested_settings_selection_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_MAUVE), @@ -1796,6 +1803,7 @@ static constexpr NWidgetPart _nested_settings_selection_widgets[] = { NWidget(WWT_RESIZEBOX, COLOUR_MAUVE), EndContainer(), }; +/* clang-format on */ static WindowDesc _settings_selection_desc( WDP_CENTER, "settings", 510, 450, @@ -2062,6 +2070,7 @@ struct CustomCurrencyWindow : Window { } }; +/* clang-format off */ static constexpr NWidgetPart _nested_cust_currency_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -2102,6 +2111,7 @@ static constexpr NWidgetPart _nested_cust_currency_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _cust_currency_desc( WDP_CENTER, nullptr, 0, 0, diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp index bcccad2cd4..2380e8c54d 100644 --- a/src/signs_gui.cpp +++ b/src/signs_gui.cpp @@ -349,6 +349,7 @@ struct SignListWindow : Window, SignList { }, SignListGlobalHotkeys}; }; +/* clang-format off */ static constexpr NWidgetPart _nested_sign_list_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_BROWN), @@ -375,6 +376,7 @@ static constexpr NWidgetPart _nested_sign_list_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _sign_list_desc( 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[] = { NWidget(NWID_HORIZONTAL), 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), EndContainer(), }; +/* clang-format on */ static WindowDesc _query_sign_edit_desc( WDP_CENTER, nullptr, 0, 0, diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp index eb4521be95..fe11e11267 100644 --- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -1965,13 +1965,16 @@ public: }; /** Widget parts of the smallmap display. */ +/* clang-format off */ static constexpr NWidgetPart _nested_smallmap_display[] = { 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(), EndContainer(), }; +/* clang-format on */ /** Widget parts of the smallmap legend bar + image buttons. */ +/* clang-format off */ static constexpr NWidgetPart _nested_smallmap_bar[] = { NWidget(WWT_PANEL, COLOUR_BROWN), NWidget(NWID_HORIZONTAL), @@ -2012,6 +2015,7 @@ static constexpr NWidgetPart _nested_smallmap_bar[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static std::unique_ptr SmallMapDisplay() { @@ -2022,6 +2026,7 @@ static std::unique_ptr SmallMapDisplay() return map_display; } +/* clang-format off */ static constexpr NWidgetPart _nested_smallmap_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_BROWN), @@ -2053,6 +2058,7 @@ static constexpr NWidgetPart _nested_smallmap_widgets[] = { NWidget(WWT_RESIZEBOX, COLOUR_BROWN), EndContainer(), }; +/* clang-format on */ static WindowDesc _smallmap_desc( WDP_AUTO, "smallmap", 484, 314, diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 0644d0a2c1..ce4ae4ddf7 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -759,6 +759,7 @@ const std::initializer_list CompanyStation &StationRatingMinSorter }; +/* clang-format off */ static constexpr NWidgetPart _nested_company_stations_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -791,6 +792,7 @@ static constexpr NWidgetPart _nested_company_stations_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _company_stations_desc( WDP_AUTO, "list_stations", 358, 162, @@ -811,6 +813,7 @@ void ShowCompanyStations(CompanyID company) AllocateWindowDescFront(_company_stations_desc, company); } +/* clang-format off */ static constexpr NWidgetPart _nested_station_view_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -847,6 +850,7 @@ static constexpr NWidgetPart _nested_station_view_widgets[] = { NWidget(WWT_RESIZEBOX, COLOUR_GREY), EndContainer(), }; +/* clang-format on */ /** * Draws icons of waiting cargo in the StationView window @@ -2262,6 +2266,7 @@ static const BaseStation *FindStationsNearby(TileArea ta, bool distant_join) return nullptr; } +/* clang-format off */ static constexpr NWidgetPart _nested_select_station_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), @@ -2276,6 +2281,7 @@ static constexpr NWidgetPart _nested_select_station_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ /** * Window for selecting stations/waypoints to (distant) join to. diff --git a/src/statusbar_gui.cpp b/src/statusbar_gui.cpp index 7dbde04b44..6307f08643 100644 --- a/src/statusbar_gui.cpp +++ b/src/statusbar_gui.cpp @@ -210,6 +210,7 @@ struct StatusBarWindow : Window { }}; }; +/* clang-format off */ static constexpr NWidgetPart _nested_main_status_widgets[] = { NWidget(NWID_HORIZONTAL), 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), EndContainer(), }; +/* clang-format on */ static WindowDesc _main_status_desc( WDP_MANUAL, nullptr, 0, 0, diff --git a/src/story_gui.cpp b/src/story_gui.cpp index c74e840185..a87304b509 100644 --- a/src/story_gui.cpp +++ b/src/story_gui.cpp @@ -937,6 +937,7 @@ const std::initializer_list Story &PageElementOrderSorter, }; +/* clang-format off */ static constexpr NWidgetPart _nested_story_book_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_BROWN), @@ -957,6 +958,7 @@ static constexpr NWidgetPart _nested_story_book_widgets[] = { NWidget(WWT_RESIZEBOX, COLOUR_BROWN), EndContainer(), }; +/* clang-format on */ static WindowDesc _story_book_desc( WDP_AUTO, "view_story", 400, 300, diff --git a/src/subsidy_gui.cpp b/src/subsidy_gui.cpp index 5f065166ef..e87f6b481c 100644 --- a/src/subsidy_gui.cpp +++ b/src/subsidy_gui.cpp @@ -262,6 +262,7 @@ struct SubsidyListWindow : Window { } }; +/* clang-format off */ static constexpr NWidgetPart _nested_subsidies_list_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_BROWN), @@ -278,6 +279,7 @@ static constexpr NWidgetPart _nested_subsidies_list_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _subsidies_list_desc( WDP_AUTO, "list_subsidies", 500, 127, diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp index 203a995b21..ab3f72521e 100644 --- a/src/terraform_gui.cpp +++ b/src/terraform_gui.cpp @@ -316,6 +316,7 @@ struct TerraformToolbarWindow : Window { }, TerraformToolbarGlobalHotkeys}; }; +/* clang-format off */ static constexpr NWidgetPart _nested_terraform_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), @@ -346,6 +347,7 @@ static constexpr NWidgetPart _nested_terraform_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _terraform_desc( 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}, }; +/* clang-format off */ static constexpr NWidgetPart _nested_scen_edit_land_gen_widgets[] = { NWidget(NWID_HORIZONTAL), 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), EndContainer(), }; +/* clang-format on */ /** * Callback function for the scenario editor 'reset landscape' confirmation window diff --git a/src/textfile_gui.cpp b/src/textfile_gui.cpp index 0ac1f3a3da..2c01796f3b 100644 --- a/src/textfile_gui.cpp +++ b/src/textfile_gui.cpp @@ -40,6 +40,7 @@ #include "safeguards.h" /** Widgets for the textfile window. */ +/* clang-format off */ static constexpr NWidgetPart _nested_textfile_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_MAUVE), @@ -74,6 +75,7 @@ static constexpr NWidgetPart _nested_textfile_widgets[] = { NWidget(WWT_RESIZEBOX, COLOUR_MAUVE), EndContainer(), }; +/* clang-format on */ /** Window definition for the textfile window */ static WindowDesc _textfile_desc( diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp index f07f7cf19e..22f2c282ef 100644 --- a/src/timetable_gui.cpp +++ b/src/timetable_gui.cpp @@ -808,6 +808,7 @@ struct TimetableWindow : Window { }}; }; +/* clang-format off */ static constexpr NWidgetPart _nested_timetable_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -853,6 +854,7 @@ static constexpr NWidgetPart _nested_timetable_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _timetable_desc( WDP_AUTO, "view_vehicle_timetable", 400, 130, diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp index f567da94f9..eaadd41d43 100644 --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -2239,9 +2239,11 @@ static std::unique_ptr MakeMainToolbar() return hor; } +/* clang-format off */ static constexpr NWidgetPart _nested_toolbar_normal_widgets[] = { NWidgetFunction(MakeMainToolbar), }; +/* clang-format on */ static WindowDesc _toolb_normal_desc( WDP_MANUAL, nullptr, 0, 0, @@ -2540,6 +2542,7 @@ struct ScenarioEditorToolbarWindow : Window { }}; }; +/* clang-format off */ 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_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_SWITCH_BAR), SetSpriteTip(SPR_IMG_SWITCH_TOOLBAR, STR_TOOLBAR_TOOLTIP_SWITCH_TOOLBAR), }; +/* clang-format on */ static std::unique_ptr MakeScenarioToolbar() { return MakeNWidgets(_nested_toolb_scen_inner_widgets, std::make_unique()); } +/* clang-format off */ static constexpr NWidgetPart _nested_toolb_scen_widgets[] = { NWidgetFunction(MakeScenarioToolbar), }; +/* clang-format on */ static WindowDesc _toolb_scen_desc( WDP_MANUAL, nullptr, 0, 0, diff --git a/src/town_gui.cpp b/src/town_gui.cpp index 78b7b0d59d..42d4994122 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -56,6 +56,7 @@ TownKdtree _town_local_authority_kdtree{}; typedef GUIList GUITownList; +/* clang-format off */ static constexpr NWidgetPart _nested_town_authority_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_BROWN), @@ -73,6 +74,7 @@ static constexpr NWidgetPart _nested_town_authority_widgets[] = { NWidget(WWT_RESIZEBOX, COLOUR_BROWN), EndContainer() }; +/* clang-format on */ /** Town authority window. */ struct TownAuthorityWindow : Window { @@ -610,6 +612,7 @@ public: }}; }; +/* clang-format off */ static constexpr NWidgetPart _nested_town_game_view_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_BROWN), @@ -632,6 +635,7 @@ static constexpr NWidgetPart _nested_town_game_view_widgets[] = { NWidget(WWT_RESIZEBOX, COLOUR_BROWN), EndContainer(), }; +/* clang-format on */ static WindowDesc _town_game_view_desc( 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 ); +/* clang-format off */ static constexpr NWidgetPart _nested_town_editor_view_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_BROWN), @@ -663,6 +668,7 @@ static constexpr NWidgetPart _nested_town_editor_view_widgets[] = { NWidget(WWT_RESIZEBOX, COLOUR_BROWN), EndContainer(), }; +/* clang-format on */ static WindowDesc _town_editor_view_desc( 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[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_BROWN), @@ -707,6 +714,7 @@ static constexpr NWidgetPart _nested_town_directory_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ /** Enum referring to the Hotkeys in the town directory window */ 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); } +/* clang-format off */ static constexpr NWidgetPart _nested_found_town_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), @@ -1141,6 +1150,7 @@ static constexpr NWidgetPart _nested_found_town_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ /** Found a town window class. */ struct FoundTownWindow : Window { @@ -1818,6 +1828,7 @@ struct BuildHouseWindow : public PickerWindow { }; /** Nested widget definition for the build NewGRF rail waypoint window */ +/* clang-format off */ static constexpr NWidgetPart _nested_build_house_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), @@ -1844,6 +1855,7 @@ static constexpr NWidgetPart _nested_build_house_widgets[] = { NWidgetFunction(MakePickerTypeWidgets), EndContainer(), }; +/* clang-format on */ static WindowDesc _build_house_desc( WDP_AUTO, "build_house", 0, 0, diff --git a/src/transparency_gui.cpp b/src/transparency_gui.cpp index 4591a610c8..aa1583f41c 100644 --- a/src/transparency_gui.cpp +++ b/src/transparency_gui.cpp @@ -126,6 +126,7 @@ public: } }; +/* clang-format off */ static constexpr NWidgetPart _nested_transparency_widgets[] = { NWidget(NWID_HORIZONTAL), 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), EndContainer(), }; +/* clang-format on */ static WindowDesc _transparency_desc( WDP_MANUAL, "toolbar_transparency", 0, 0, diff --git a/src/tree_gui.cpp b/src/tree_gui.cpp index 79cf837db3..1c4e202325 100644 --- a/src/tree_gui.cpp +++ b/src/tree_gui.cpp @@ -285,6 +285,7 @@ static std::unique_ptr MakeTreeTypeButtons() return vstack; } +/* clang-format off */ static constexpr NWidgetPart _nested_build_trees_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), @@ -309,6 +310,7 @@ static constexpr NWidgetPart _nested_build_trees_widgets[] = { EndContainer(), EndContainer(), }; +/* clang-format on */ static WindowDesc _build_trees_desc( WDP_AUTO, "build_tree", 0, 0, diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index d78ba5723b..1d8fadeb65 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -1308,6 +1308,7 @@ struct RefitWindow : public Window { } }; +/* clang-format off */ static constexpr NWidgetPart _nested_vehicle_refit_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -1333,6 +1334,7 @@ static constexpr NWidgetPart _nested_vehicle_refit_widgets[] = { NWidget(WWT_RESIZEBOX, COLOUR_GREY), EndContainer(), }; +/* clang-format on */ static WindowDesc _vehicle_refit_desc( 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); } +/* clang-format off */ static constexpr NWidgetPart _nested_vehicle_list[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -1653,6 +1656,7 @@ static constexpr NWidgetPart _nested_vehicle_list[] = { NWidget(WWT_RESIZEBOX, COLOUR_GREY), EndContainer(), }; +/* clang-format on */ 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 ); /** Vehicle details widgets (other than train). */ +/* clang-format off */ static constexpr NWidgetPart _nested_nontrain_vehicle_details_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -2347,8 +2352,10 @@ static constexpr NWidgetPart _nested_nontrain_vehicle_details_widgets[] = { NWidget(WWT_RESIZEBOX, COLOUR_GREY), EndContainer(), }; +/* clang-format on */ /** Train details widgets. */ +/* clang-format off */ static constexpr NWidgetPart _nested_train_vehicle_details_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -2383,6 +2390,7 @@ static constexpr NWidgetPart _nested_train_vehicle_details_widgets[] = { NWidget(WWT_RESIZEBOX, COLOUR_GREY), EndContainer(), }; +/* clang-format on */ 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 */ /** Vehicle view widgets. */ +/* clang-format off */ static constexpr NWidgetPart _nested_vehicle_view_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -2863,6 +2872,7 @@ static constexpr NWidgetPart _nested_vehicle_view_widgets[] = { NWidget(WWT_RESIZEBOX, COLOUR_GREY), EndContainer(), }; +/* clang-format on */ /* 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. */ diff --git a/src/viewport_gui.cpp b/src/viewport_gui.cpp index 3d4271e08d..ccdf39ba71 100644 --- a/src/viewport_gui.cpp +++ b/src/viewport_gui.cpp @@ -23,6 +23,7 @@ #include "safeguards.h" /* Extra Viewport Window Stuff */ +/* clang-format off */ static constexpr NWidgetPart _nested_extra_viewport_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -49,6 +50,7 @@ static constexpr NWidgetPart _nested_extra_viewport_widgets[] = { NWidget(WWT_RESIZEBOX, COLOUR_GREY), EndContainer(), }; +/* clang-format on */ class ExtraViewportWindow : public Window { public: diff --git a/src/waypoint_gui.cpp b/src/waypoint_gui.cpp index c8165f64c4..fabd91e715 100644 --- a/src/waypoint_gui.cpp +++ b/src/waypoint_gui.cpp @@ -187,6 +187,7 @@ public: }; /** The widgets of the waypoint view. */ +/* clang-format off */ static constexpr NWidgetPart _nested_waypoint_view_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), @@ -208,6 +209,7 @@ static constexpr NWidgetPart _nested_waypoint_view_widgets[] = { NWidget(WWT_RESIZEBOX, COLOUR_GREY), EndContainer(), }; +/* clang-format on */ /** The description of the waypoint view. */ static WindowDesc _waypoint_view_desc(