diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -76,7 +76,7 @@ struct AIListWindow : public Window { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget == AIL_WIDGET_LIST) { this->line_height = FONT_HEIGHT_NORMAL + WD_MATRIX_TOP + WD_MATRIX_BOTTOM; @@ -279,7 +279,7 @@ struct AISettingsWindow : public Window this->vscroll.SetCount((int)this->ai_config->GetConfigList()->size()); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget == AIS_WIDGET_BACKGROUND) { this->line_height = FONT_HEIGHT_NORMAL + WD_MATRIX_TOP + WD_MATRIX_BOTTOM; @@ -544,7 +544,7 @@ struct AIConfigWindow : public Window { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case AIC_WIDGET_LIST: @@ -698,7 +698,7 @@ struct AIDebugWindow : public Window { if (ai_debug_company != INVALID_COMPANY) this->LowerWidget(ai_debug_company + AID_WIDGET_COMPANY_BUTTON_START); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget == AID_WIDGET_LOG_PANEL) { resize->height = FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL; diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp --- a/src/autoreplace_gui.cpp +++ b/src/autoreplace_gui.cpp @@ -231,7 +231,7 @@ public: this->sel_group = id_g; } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case RVW_WIDGET_LEFT_MATRIX: diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -164,7 +164,7 @@ public: this->DrawWidgets(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case BBSW_DROPDOWN_ORDER: { diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -1086,7 +1086,7 @@ struct BuildVehicleWindow : Window { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case BUILD_VEHICLE_WIDGET_LIST: diff --git a/src/cheat_gui.cpp b/src/cheat_gui.cpp --- a/src/cheat_gui.cpp +++ b/src/cheat_gui.cpp @@ -215,7 +215,7 @@ struct CheatWindow : Window { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget != CW_PANEL) return; diff --git a/src/company_gui.cpp b/src/company_gui.cpp --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -320,7 +320,7 @@ struct CompanyFinancesWindow : Window { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { int type = _settings_client.gui.expenses_layout; switch (widget) { @@ -596,7 +596,7 @@ public: this->LowerWidget(SCLW_WIDGET_CLASS_GENERAL); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { /* Number of liveries in each class, used to determine the height of the livery matrix widget. */ static const byte livery_height[] = { @@ -1646,7 +1646,7 @@ struct CompanyWindow : Window this->DrawWidgets(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case CW_WIDGET_DESC_COMPANY_VALUE: @@ -1922,7 +1922,7 @@ struct BuyCompanyWindow : Window { this->DrawWidgets(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case BCW_FACE: diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -612,7 +612,7 @@ struct DepotWindow : Window { uint flag_width; uint flag_height; - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case DEPOT_WIDGET_SELL_CHAIN: diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp --- a/src/engine_gui.cpp +++ b/src/engine_gui.cpp @@ -80,7 +80,7 @@ struct EnginePreviewWindow : Window { this->DrawWidgets(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget != EPW_QUESTION) return; diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp --- a/src/genworld_gui.cpp +++ b/src/genworld_gui.cpp @@ -411,7 +411,7 @@ struct GenerateLandscapeWindow : public } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { const StringID *strs = NULL; switch (widget) { @@ -901,7 +901,7 @@ struct CreateScenarioWindow : public Win this->DrawWidgets(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { StringID str = STR_JUST_INT; switch (widget) { @@ -1188,7 +1188,7 @@ struct GenerateProgressWindow : public W this->DrawWidgets(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case GPWW_PROGRESS_BAR: { diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -786,7 +786,7 @@ struct PaymentRatesGraphWindow : BaseGra this->InitNested(desc, window_number); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget < CPW_CARGO_FIRST) return; @@ -1109,7 +1109,7 @@ struct PerformanceRatingDetailWindow : W uint score_detail_left; uint score_detail_right; - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case PRW_SCORE_FIRST: diff --git a/src/group_gui.cpp b/src/group_gui.cpp --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -249,7 +249,7 @@ public: *this->sorting = this->vehicles.GetListing(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case GRP_WIDGET_LIST_GROUP: diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -207,7 +207,7 @@ public: this->InitNested(&_build_industry_desc, 0); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case DPIW_MATRIX_WIDGET: { @@ -702,7 +702,7 @@ public: if (widget== IVW_CAPTION) SetDParam(0, this->window_number); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget == IVW_INFO) size->height = this->info_height; } @@ -1077,7 +1077,7 @@ public: } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case IDW_DROPDOWN_ORDER: { diff --git a/src/intro_gui.cpp b/src/intro_gui.cpp --- a/src/intro_gui.cpp +++ b/src/intro_gui.cpp @@ -84,7 +84,7 @@ struct SelectGameWindow : public Window if (widget == SGI_DIFFICULTIES) SetDParam(0, STR_DIFFICULTY_LEVEL_EASY + _settings_newgame.difficulty.diff_level); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget != SGI_DIFFICULTIES) return; diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -114,7 +114,7 @@ public: } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget != LIW_BACKGROUND) return; @@ -432,7 +432,7 @@ struct AboutWindow : public Window { if (widget == AW_WEBSITE) SetDParamStr(0, "Website: http://www.openttd.org"); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget != AW_SCROLLING_TEXT) return; @@ -559,7 +559,7 @@ public: this->InitNested(desc); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget != EMW_MESSAGE) return; @@ -823,7 +823,7 @@ struct TooltipsWindow : public Window return pt; } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { /* There is only one widget. */ for (uint i = 0; i != this->paramcount; i++) SetDParam(i, this->params[i]); @@ -1339,7 +1339,7 @@ struct QueryStringWindow : public QueryS this->LowerWidget(QUERY_STR_WIDGET_TEXT); } - void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget == QUERY_STR_WIDGET_DEFAULT && (this->flags & QSF_ENABLE_DEFAULT) == 0) { this->GetWidget(widget)->SetFill(0, 1); @@ -1518,7 +1518,7 @@ struct QueryWindow : public Window { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget != QUERY_WIDGET_TEXT) return; @@ -1865,7 +1865,7 @@ public: } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case SLWW_CONTENT_DOWNLOAD_SEL: diff --git a/src/music_gui.cpp b/src/music_gui.cpp --- a/src/music_gui.cpp +++ b/src/music_gui.cpp @@ -250,7 +250,7 @@ struct MusicTrackSelectionWindow : publi this->SetDirty(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case MTSW_PLAYLIST: { @@ -462,7 +462,7 @@ struct MusicWindow : public Window { this->SetWidgetLoweredState(MW_SHUFFLE, msf.shuffle); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { /* Make sure that MW_SHUFFLE and MW_PROGRAMME have the same size. diff --git a/src/network/network_chat_gui.cpp b/src/network/network_chat_gui.cpp --- a/src/network/network_chat_gui.cpp +++ b/src/network/network_chat_gui.cpp @@ -455,7 +455,7 @@ struct NetworkChatWindow : public QueryS return pt; } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget != NWCW_DESTINATION) return; diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -376,7 +376,7 @@ public: _network_content_client.RemoveCallback(this); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case NCLWW_FILTER_CAPT: diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -481,7 +481,7 @@ public: } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case NGWW_CONN_BTN: @@ -1108,7 +1108,7 @@ struct NetworkStartServerWindow : public } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case NSSW_CONNTYPE_BTN: @@ -1486,7 +1486,7 @@ struct NetworkLobbyWindow : public Windo return COMPANY_FIRST; } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case NLWW_HEADER: @@ -1904,7 +1904,7 @@ struct NetworkClientListPopupWindow : Wi return this->desired_location; } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { Dimension d = *size; for (const ClientListAction *action = this->actions.Begin(); action != this->actions.End(); action++) { @@ -2037,7 +2037,7 @@ struct NetworkClientListWindow : Window return true; } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget != CLW_PANEL) return; diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -264,7 +264,7 @@ public: this->SetWidgetDisabledState(ANGRFW_ADD, this->sel == NULL || this->sel->IsOpenTTDBaseGRF()); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case ANGRFW_GRF_LIST: @@ -580,7 +580,7 @@ struct NewGRFWindow : public Window { _grf_preset_list.Clear(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case SNGRFS_FILE_LIST: diff --git a/src/news_gui.cpp b/src/news_gui.cpp --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -344,7 +344,7 @@ struct NewsWindow : Window { this->DrawWidgets(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { StringID str = STR_NULL; switch (widget) { @@ -927,7 +927,7 @@ struct MessageHistoryWindow : Window { this->OnInvalidateData(0); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget == MHW_BACKGROUND) { this->line_height = FONT_HEIGHT_NORMAL + 2; @@ -1114,7 +1114,7 @@ struct MessageOptionsWindow : Window { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget >= WIDGET_NEWSOPT_START_OPTION && widget < WIDGET_NEWSOPT_END_OPTION) { /* Height is the biggest widget height in a row. */ diff --git a/src/order_gui.cpp b/src/order_gui.cpp --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -690,7 +690,7 @@ public: this->OnInvalidateData(-2); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case ORDER_WIDGET_TIMETABLE_VIEW: diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -1085,7 +1085,7 @@ public: } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case BRSW_NEWST_DROPDOWN: { diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -229,7 +229,7 @@ struct GameOptionsWindow : Window { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case GOW_BASE_GRF_DESCRIPTION: @@ -569,7 +569,7 @@ public: SetDParam(0, sd->desc.str + value); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { /* Only for the 'descriptions' */ int index = widget - GDW_OPTIONS_START; @@ -1477,7 +1477,7 @@ struct GameSettingsWindow : Window { this->vscroll.SetCount(_settings_main_page.Length()); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget != SETTINGSEL_OPTIONSPANEL) return; @@ -1760,7 +1760,7 @@ struct CustomCurrencyWindow : Window { } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { /* Set the appropriate width for the edit 'buttons' */ diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp --- a/src/signs_gui.cpp +++ b/src/signs_gui.cpp @@ -164,7 +164,7 @@ struct SignListWindow : Window, SignList this->vscroll.SetCapacity((this->GetWidget(SLW_LIST)->current_y - WD_FRAMERECT_TOP - WD_FRAMERECT_BOTTOM) / this->resize.step_height); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case SLW_LIST: { diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp --- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -856,7 +856,7 @@ public: } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget != SM_WIDGET_LEGEND) return; diff --git a/src/station_gui.cpp b/src/station_gui.cpp --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -291,7 +291,7 @@ public: this->last_sorting = this->stations.GetListing(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case SLW_SORTDROPBTN: { @@ -808,7 +808,7 @@ struct StationViewWindow : public Window DeleteWindowById(WC_AIRCRAFT_LIST, wno | (VEH_AIRCRAFT << 11), false); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case SVW_WAITING: @@ -1293,7 +1293,7 @@ struct SelectStationWindow : Window { this->OnInvalidateData(0); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget != JSW_PANEL) return; diff --git a/src/statusbar_gui.cpp b/src/statusbar_gui.cpp --- a/src/statusbar_gui.cpp +++ b/src/statusbar_gui.cpp @@ -109,7 +109,7 @@ struct StatusBarWindow : Window { this->DrawWidgets(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { size->height = FONT_HEIGHT_NORMAL + padding.height; } diff --git a/src/subsidy_gui.cpp b/src/subsidy_gui.cpp --- a/src/subsidy_gui.cpp +++ b/src/subsidy_gui.cpp @@ -141,7 +141,7 @@ struct SubsidyListWindow : Window { return 3 + num_awarded + num_not_awarded; } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget != SLW_PANEL) return; Dimension d = maxdim(GetStringBoundingBox(STR_SUBSIDIES_OFFERED_TITLE), GetStringBoundingBox(STR_SUBSIDIES_SUBSIDISED_TITLE)); diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp --- a/src/timetable_gui.cpp +++ b/src/timetable_gui.cpp @@ -68,7 +68,7 @@ struct TimetableWindow : Window { this->sel_index = -1; } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case TTV_TIMETABLE_PANEL: diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -1437,7 +1437,7 @@ public: } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case TBSE_SPACERPANEL: diff --git a/src/town_gui.cpp b/src/town_gui.cpp --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -211,7 +211,7 @@ public: } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case TWA_ACTION_INFO: { @@ -717,7 +717,7 @@ public: } } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case TDW_SORTNAME: diff --git a/src/tree_gui.cpp b/src/tree_gui.cpp --- a/src/tree_gui.cpp +++ b/src/tree_gui.cpp @@ -62,7 +62,7 @@ public: ResetObjectToPlace(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget != BTW_MANY_RANDOM) return; diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -351,7 +351,7 @@ struct RefitWindow : public Window { this->DrawWidgets(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case VRW_MATRIX: @@ -956,7 +956,7 @@ public: *this->sorting = this->vehicles.GetListing(); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { if (widget != VLW_WIDGET_LIST) return; @@ -1361,7 +1361,7 @@ struct VehicleDetailsWindow : Window { this->tab = TDW_TAB_CARGO; } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { case VLD_WIDGET_TOP_DETAILS: @@ -1849,7 +1849,7 @@ public: DeleteWindowById(WC_VEHICLE_TIMETABLE, this->window_number, false); } - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { const Vehicle *v = Vehicle::Get(this->window_number); switch (widget) { diff --git a/src/widget.cpp b/src/widget.cpp --- a/src/widget.cpp +++ b/src/widget.cpp @@ -955,17 +955,17 @@ void NWidgetStacked::SetupSmallestSize(W /* Zero size plane selected */ if (this->shown_plane == STACKED_SELECTION_ZERO_SIZE) { - this->fill_x = 0; - this->fill_y = 0; - Dimension size = {0, 0}; + Dimension padding = {0, 0}; + Dimension fill = {0, 0}; Dimension resize = {0, 0}; - Dimension padding = {0, 0}; /* Here we're primarily interested in the value of resize */ - w->UpdateWidgetSize(this->index, &size, padding, &resize); + w->UpdateWidgetSize(this->index, &size, padding, &fill, &resize); this->smallest_x = size.width; this->smallest_y = size.height; + this->fill_x = fill.width; + this->fill_y = fill.height; this->resize_x = resize.width; this->resize_y = resize.height; return; @@ -1453,6 +1453,7 @@ void NWidgetBackground::SetupSmallestSiz } } else { Dimension d = {this->min_x, this->min_y}; + Dimension fill = {this->fill_x, this->fill_y}; Dimension resize = {this->resize_x, this->resize_y}; if (w != NULL) { // A non-NULL window pointer acts as switch to turn dynamic widget size on. if (this->type == WWT_FRAME || this->type == WWT_INSET) { @@ -1463,11 +1464,13 @@ void NWidgetBackground::SetupSmallestSiz } if (this->index >= 0) { static const Dimension padding = {0, 0}; - w->UpdateWidgetSize(this->index, &d, padding, &resize); + w->UpdateWidgetSize(this->index, &d, padding, &fill, &resize); } } this->smallest_x = d.width; this->smallest_y = d.height; + this->fill_x = fill.width; + this->fill_y = fill.height; this->resize_x = resize.width; this->resize_y = resize.height; } @@ -1744,6 +1747,7 @@ void NWidgetLeaf::SetupSmallestSize(Wind /* A non-NULL window pointer acts as switch to turn dynamic widget sizing on. */ Dimension size = {this->min_x, this->min_y}; + Dimension fill = {this->fill_x, this->fill_y}; Dimension resize = {this->resize_x, this->resize_y}; /* Get padding, and update size with the real content size if appropriate. */ const Dimension *padding = NULL; @@ -1869,13 +1873,14 @@ void NWidgetLeaf::SetupSmallestSize(Wind NOT_REACHED(); } - if (this->index >= 0) w->UpdateWidgetSize(this->index, &size, *padding, &resize); + if (this->index >= 0) w->UpdateWidgetSize(this->index, &size, *padding, &fill, &resize); this->smallest_x = size.width; this->smallest_y = size.height; + this->fill_x = fill.width; + this->fill_y = fill.height; this->resize_x = resize.width; this->resize_y = resize.height; - /* this->fill_x and this->fill_y are already correct. */ } void NWidgetLeaf::Draw(const Window *w) diff --git a/src/window_gui.h b/src/window_gui.h --- a/src/window_gui.h +++ b/src/window_gui.h @@ -577,9 +577,10 @@ public: * @param widget Widget number. * @param size Size of the widget. * @param padding Recommended amount of space between the widget content and the widget edge. + * @param fill Fill step of the widget. * @param resize Resize step of the widget. */ - virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *resize) {} + virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) {} /** * Initialize string parameters for a widget.