diff options
author | Peter Nelson <peter1138@openttd.org> | 2021-04-21 15:22:45 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2021-04-21 23:12:10 +0200 |
commit | 2a0365b3d992fb602fd91b218b4a8647ddb46975 (patch) | |
tree | 54ec865630b8292ce84eb47fff78f407411926ab /src/group_gui.cpp | |
parent | 96b78bc2cd9790e89228c53b4803a78320fc20bd (diff) | |
download | openttd-2a0365b3d992fb602fd91b218b4a8647ddb46975.tar.xz |
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.
Diffstat (limited to 'src/group_gui.cpp')
-rw-r--r-- | src/group_gui.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/group_gui.cpp b/src/group_gui.cpp index a8b4c5f17..372053304 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -676,7 +676,7 @@ public: break; case WID_GL_LIST_GROUP: { // Matrix Group - uint id_g = this->group_sb->GetScrolledRowFromWidget(pt.y, this, WID_GL_LIST_GROUP, 0, this->tiny_step_height); + uint id_g = this->group_sb->GetScrolledRowFromWidget(pt.y, this, WID_GL_LIST_GROUP); if (id_g >= this->groups.size()) return; if (groups[id_g]->folded || (id_g + 1 < this->groups.size() && this->indents[id_g + 1] > this->indents[id_g])) { @@ -822,7 +822,7 @@ public: break; case WID_GL_LIST_GROUP: { // Matrix group - uint id_g = this->group_sb->GetScrolledRowFromWidget(pt.y, this, WID_GL_LIST_GROUP, 0, this->tiny_step_height); + uint id_g = this->group_sb->GetScrolledRowFromWidget(pt.y, this, WID_GL_LIST_GROUP); GroupID new_g = id_g >= this->groups.size() ? INVALID_GROUP : this->groups[id_g]->index; if (this->group_sel != new_g && g->parent != new_g) { @@ -855,7 +855,7 @@ public: this->group_over = INVALID_GROUP; this->SetDirty(); - uint id_g = this->group_sb->GetScrolledRowFromWidget(pt.y, this, WID_GL_LIST_GROUP, 0, this->tiny_step_height); + uint id_g = this->group_sb->GetScrolledRowFromWidget(pt.y, this, WID_GL_LIST_GROUP); GroupID new_g = id_g >= this->groups.size() ? NEW_GROUP : this->groups[id_g]->index; DoCommandP(0, new_g, vindex | (_ctrl_pressed || this->grouping == GB_SHARED_ORDERS ? 1 << 31 : 0), CMD_ADD_VEHICLE_GROUP | CMD_MSG(STR_ERROR_GROUP_CAN_T_ADD_VEHICLE), new_g == NEW_GROUP ? CcAddVehicleNewGroup : nullptr); @@ -996,7 +996,7 @@ public: break; case WID_GL_LIST_GROUP: { // ... the list of custom groups. - uint id_g = this->group_sb->GetScrolledRowFromWidget(pt.y, this, WID_GL_LIST_GROUP, 0, this->tiny_step_height); + uint id_g = this->group_sb->GetScrolledRowFromWidget(pt.y, this, WID_GL_LIST_GROUP); new_group_over = id_g >= this->groups.size() ? NEW_GROUP : this->groups[id_g]->index; break; } |