summaryrefslogtreecommitdiff
path: root/src/fios_gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/fios_gui.cpp')
-rw-r--r--src/fios_gui.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/fios_gui.cpp b/src/fios_gui.cpp
index 8ee17d4bd..7cf6bb3d4 100644
--- a/src/fios_gui.cpp
+++ b/src/fios_gui.cpp
@@ -531,9 +531,8 @@ public:
break;
case SLWW_DRIVES_DIRECTORIES_LIST: { // Click the listbox
- int y = (pt.y - this->GetWidget<NWidgetBase>(SLWW_DRIVES_DIRECTORIES_LIST)->pos_y - WD_FRAMERECT_TOP) / this->resize.step_height;
-
- if (y < 0 || (y += this->vscroll.GetPosition()) >= this->vscroll.GetCount()) return;
+ int y = this->vscroll.GetScrolledRowFromWidget(pt.y, this, SLWW_DRIVES_DIRECTORIES_LIST, WD_FRAMERECT_TOP);
+ if (y == INT_MAX) return;
const FiosItem *file = _fios_items.Get(y);