From 2a0365b3d992fb602fd91b218b4a8647ddb46975 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Wed, 21 Apr 2021 15:22:45 +0100 Subject: Cleanup: Remove unnecessary parameter of GetScrolledRowFromWidget() Line height defaults to the resize height of the relevant widget, which is set in all cases. Therefore it is not necessary to specify this value every time. Additionally fixes scrolled padding for the framerate window. --- src/ai/ai_gui.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/ai/ai_gui.cpp') diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index 14fc65cc8..49e37621e 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -190,7 +190,7 @@ struct AIListWindow : public Window { { switch (widget) { case WID_AIL_LIST: { // Select one of the AIs - int sel = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_AIL_LIST, 0, this->line_height) - 1; + int sel = this->vscroll->GetScrolledRowFromWidget(pt.y, this, WID_AIL_LIST) - 1; if (sel < (int)this->info_list->size()) { this->selected = sel; this->SetDirty(); @@ -784,6 +784,7 @@ struct AIConfigWindow : public Window { case WID_AIC_LIST: this->line_height = FONT_HEIGHT_NORMAL + WD_MATRIX_TOP + WD_MATRIX_BOTTOM; + resize->height = this->line_height; size->height = 8 * this->line_height; break; @@ -895,7 +896,7 @@ struct AIConfigWindow : public Window { } case WID_AIC_LIST: { // Select a slot - this->selected_slot = (CompanyID)this->vscroll->GetScrolledRowFromWidget(pt.y, this, widget, 0, this->line_height); + this->selected_slot = (CompanyID)this->vscroll->GetScrolledRowFromWidget(pt.y, this, widget); this->InvalidateData(); if (click_count > 1 && this->selected_slot != INVALID_COMPANY) ShowAIListWindow((CompanyID)this->selected_slot); break; -- cgit v1.2.3-70-g09d2