Merge branch 'master' into jgrpp
# Conflicts: # src/autoreplace_gui.cpp # src/build_vehicle_gui.cpp # src/cheat_gui.cpp # src/company_gui.cpp # src/debug.cpp # src/engine_gui.h # src/error_gui.cpp # src/group_gui.cpp # src/industry_cmd.cpp # src/industry_gui.cpp # src/misc_gui.cpp # src/network/network_gui.cpp # src/newgrf.cpp # src/newgrf_debug_gui.cpp # src/newgrf_gui.cpp # src/order_gui.cpp # src/rail_gui.cpp # src/road_gui.cpp # src/saveload/saveload.cpp # src/screenshot_gui.cpp # src/sound/win32_s.cpp # src/statusbar_gui.cpp # src/strgen/strgen.cpp # src/table/newgrf_debug_data.h # src/timetable_gui.cpp # src/toolbar_gui.cpp # src/town_gui.cpp # src/vehicle_gui.cpp # src/video/sdl2_v.cpp # src/video/sdl_v.cpp # src/viewport.cpp
This commit is contained in:
@@ -1454,7 +1454,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateWidgetSize(WidgetID widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override
|
||||
void UpdateWidgetSize(WidgetID widget, Dimension &size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension &fill, [[maybe_unused]] Dimension &resize) override
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_BRAS_NEWST_LIST: {
|
||||
@@ -1462,17 +1462,17 @@ public:
|
||||
for (auto station_class : this->station_classes) {
|
||||
d = maxdim(d, GetStringBoundingBox(StationClass::Get(station_class)->name));
|
||||
}
|
||||
size->width = std::max(size->width, d.width + padding.width);
|
||||
size.width = std::max(size.width, d.width + padding.width);
|
||||
this->line_height = GetCharacterHeight(FS_NORMAL) + padding.height;
|
||||
size->height = 5 * this->line_height;
|
||||
resize->height = this->line_height;
|
||||
size.height = 5 * this->line_height;
|
||||
resize.height = this->line_height;
|
||||
break;
|
||||
}
|
||||
|
||||
case WID_BRAS_SHOW_NEWST_TYPE: {
|
||||
if (!_railstation.newstations) {
|
||||
size->width = 0;
|
||||
size->height = 0;
|
||||
size.width = 0;
|
||||
size.height = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1487,25 +1487,25 @@ public:
|
||||
d = maxdim(d, GetStringBoundingBox(str));
|
||||
}
|
||||
}
|
||||
size->width = std::max(size->width, d.width + padding.width);
|
||||
size->width = std::min<uint>(size->width, ScaleGUITrad(400));
|
||||
size.width = std::max(size.width, d.width + padding.width);
|
||||
size.width = std::min<uint>(size.width, ScaleGUITrad(400));
|
||||
break;
|
||||
}
|
||||
|
||||
case WID_BRAS_PLATFORM_DIR_X:
|
||||
case WID_BRAS_PLATFORM_DIR_Y:
|
||||
case WID_BRAS_IMAGE:
|
||||
size->width = ScaleGUITrad(64) + WidgetDimensions::scaled.fullbevel.Horizontal();
|
||||
size->height = ScaleGUITrad(58) + WidgetDimensions::scaled.fullbevel.Vertical();
|
||||
size.width = ScaleGUITrad(64) + WidgetDimensions::scaled.fullbevel.Horizontal();
|
||||
size.height = ScaleGUITrad(58) + WidgetDimensions::scaled.fullbevel.Vertical();
|
||||
break;
|
||||
|
||||
case WID_BRAS_COVERAGE_TEXTS:
|
||||
size->height = this->coverage_height;
|
||||
size.height = this->coverage_height;
|
||||
break;
|
||||
|
||||
case WID_BRAS_MATRIX:
|
||||
fill->height = 1;
|
||||
resize->height = 1;
|
||||
fill.height = 1;
|
||||
resize.height = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -2056,16 +2056,16 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateWidgetSize(WidgetID widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override
|
||||
void UpdateWidgetSize(WidgetID widget, Dimension &size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension &fill, [[maybe_unused]] Dimension &resize) override
|
||||
{
|
||||
if (widget == WID_BS_DRAG_SIGNALS_DENSITY_LABEL) {
|
||||
/* Two digits for signals density. */
|
||||
size->width = std::max(size->width, 2 * GetDigitWidth() + padding.width + WidgetDimensions::scaled.framerect.Horizontal());
|
||||
size.width = std::max(size.width, 2 * GetDigitWidth() + padding.width + WidgetDimensions::scaled.framerect.Horizontal());
|
||||
} else if (IsInsideMM(widget, WID_BS_SEMAPHORE_NORM, WID_BS_ELECTRIC_PBS_OWAY + 1)) {
|
||||
size->width = std::max(size->width, this->sig_sprite_size.width + padding.width);
|
||||
size->height = std::max(size->height, this->sig_sprite_size.height + padding.height);
|
||||
size.width = std::max(size.width, this->sig_sprite_size.width + padding.width);
|
||||
size.height = std::max(size.height, this->sig_sprite_size.height + padding.height);
|
||||
} else if (widget == WID_BS_CAPTION) {
|
||||
size->width += WidgetDimensions::scaled.frametext.Horizontal();
|
||||
size.width += WidgetDimensions::scaled.frametext.Horizontal();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2399,12 +2399,12 @@ struct BuildRailDepotWindow : public PickerWindowBase {
|
||||
this->LowerWidget(WID_BRAD_DEPOT_NE + _build_depot_direction);
|
||||
}
|
||||
|
||||
void UpdateWidgetSize(WidgetID widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override
|
||||
void UpdateWidgetSize(WidgetID widget, Dimension &size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension &fill, [[maybe_unused]] Dimension &resize) override
|
||||
{
|
||||
if (!IsInsideMM(widget, WID_BRAD_DEPOT_NE, WID_BRAD_DEPOT_NW + 1)) return;
|
||||
|
||||
size->width = ScaleGUITrad(64) + WidgetDimensions::scaled.fullbevel.Horizontal();
|
||||
size->height = ScaleGUITrad(48) + WidgetDimensions::scaled.fullbevel.Vertical();
|
||||
size.width = ScaleGUITrad(64) + WidgetDimensions::scaled.fullbevel.Horizontal();
|
||||
size.height = ScaleGUITrad(48) + WidgetDimensions::scaled.fullbevel.Vertical();
|
||||
}
|
||||
|
||||
void DrawWidget(const Rect &r, WidgetID widget) const override
|
||||
@@ -2554,21 +2554,21 @@ struct BuildRailWaypointWindow : PickerWindowBase {
|
||||
this->PickerWindowBase::Close(data);
|
||||
}
|
||||
|
||||
void UpdateWidgetSize(WidgetID widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
|
||||
void UpdateWidgetSize(WidgetID widget, Dimension &size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension &fill, [[maybe_unused]] Dimension &resize) override
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_BRW_WAYPOINT_MATRIX:
|
||||
/* Two blobs high and three wide. */
|
||||
size->width += resize->width * 2;
|
||||
size->height += resize->height * 1;
|
||||
size.width += resize.width * 2;
|
||||
size.height += resize.height * 1;
|
||||
|
||||
/* Resizing in X direction only at blob size, but at pixel level in Y. */
|
||||
resize->height = 1;
|
||||
resize.height = 1;
|
||||
break;
|
||||
|
||||
case WID_BRW_WAYPOINT:
|
||||
size->width = ScaleGUITrad(64) + WidgetDimensions::scaled.fullbevel.Horizontal();
|
||||
size->height = ScaleGUITrad(58) + WidgetDimensions::scaled.fullbevel.Vertical();
|
||||
size.width = ScaleGUITrad(64) + WidgetDimensions::scaled.fullbevel.Horizontal();
|
||||
size.height = ScaleGUITrad(58) + WidgetDimensions::scaled.fullbevel.Vertical();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user