Codechange: Remove unused parameter for Height()

DropDownListItem::Height does not need to take an argument so remove it

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
This commit is contained in:
Bernhard Reutner-Fischer
2023-09-19 00:47:47 +02:00
committed by rubidium42
parent 59a2abd298
commit ac42dea7b2
5 changed files with 10 additions and 11 deletions

View File

@@ -67,7 +67,7 @@ DropDownListIconItem::DropDownListIconItem(SpriteID sprite, PaletteID pal, Strin
this->sprite_y = dim.height;
}
uint DropDownListIconItem::Height(uint) const
uint DropDownListIconItem::Height() const
{
return std::max(this->dim.height, (uint)FONT_HEIGHT_NORMAL);
}
@@ -158,7 +158,7 @@ struct DropdownWindow : Window {
/* Total length of list */
int list_height = 0;
for (const auto &item : this->list) {
list_height += item->Height(items_width);
list_height += item->Height();
}
/* Capacity is the average number of items visible */
@@ -213,14 +213,13 @@ struct DropdownWindow : Window {
const Rect &r = this->GetWidget<NWidgetBase>(WID_DM_ITEMS)->GetCurrentRect().Shrink(WidgetDimensions::scaled.fullbevel);
int y = _cursor.pos.y - this->top - r.top - WidgetDimensions::scaled.fullbevel.top;
int width = r.Width();
int pos = this->vscroll->GetPosition();
for (const auto &item : this->list) {
/* Skip items that are scrolled up */
if (--pos >= 0) continue;
int item_height = item->Height(width);
int item_height = item->Height();
if (y < item_height) {
if (item->masked || !item->Selectable()) return false;
@@ -244,7 +243,7 @@ struct DropdownWindow : Window {
int y = ir.top;
int pos = this->vscroll->GetPosition();
for (const auto &item : this->list) {
int item_height = item->Height(ir.Width());
int item_height = item->Height();
/* Skip items that are scrolled up */
if (--pos >= 0) continue;
@@ -353,7 +352,7 @@ void ShowDropDownListAt(Window *w, DropDownList &&list, int selected, int button
uint height = 0;
for (const auto &item : list) {
height += item->Height(width);
height += item->Height();
max_item_width = std::max(max_item_width, item->Width());
}