Codechange: Pass by reference to UpdateWidgetSize. (#12457)

These parameters are always provided and not optional.
This commit is contained in:
2024-04-09 08:34:45 +01:00
committed by GitHub
parent b5ad28022d
commit de4e00c93f
55 changed files with 602 additions and 602 deletions

View File

@@ -561,23 +561,23 @@ 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_SL_BACKGROUND:
size->height = 2 * GetCharacterHeight(FS_NORMAL) + padding.height;
size.height = 2 * GetCharacterHeight(FS_NORMAL) + padding.height;
break;
case WID_SL_DRIVES_DIRECTORIES_LIST:
resize->height = GetCharacterHeight(FS_NORMAL);
size->height = resize->height * 10 + padding.height;
resize.height = GetCharacterHeight(FS_NORMAL);
size.height = resize.height * 10 + padding.height;
break;
case WID_SL_SORT_BYNAME:
case WID_SL_SORT_BYDATE: {
Dimension d = GetStringBoundingBox(this->GetWidget<NWidgetCore>(widget)->widget_data);
d.width += padding.width + Window::SortButtonWidth() * 2; // Doubled since the string is centred and it also looks better.
d.height += padding.height;
*size = maxdim(*size, d);
size = maxdim(size, d);
break;
}
}