aboutsummaryrefslogtreecommitdiff
path: root/gui/PopUpWidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/PopUpWidget.cpp')
-rw-r--r--gui/PopUpWidget.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/gui/PopUpWidget.cpp b/gui/PopUpWidget.cpp
index 74c441e916..4c9dd8d81a 100644
--- a/gui/PopUpWidget.cpp
+++ b/gui/PopUpWidget.cpp
@@ -379,6 +379,23 @@ void PopUpWidget::handleMouseDown(int x, int y, int button, int clickCount) {
}
}
+void PopUpWidget::handleMouseWheel(int x, int y, int direction) {
+ int newSelection = _selectedItem + direction;
+
+ // Skip separator entries
+ while ((newSelection >= 0) && (newSelection < (int)_entries.size()) &&
+ _entries[newSelection].name.equals("")) {
+ newSelection += direction;
+ }
+
+ // Just update the selected item when we're in range
+ if ((newSelection >= 0) && (newSelection < (int)_entries.size()) &&
+ (newSelection != _selectedItem)) {
+ _selectedItem = newSelection;
+ draw();
+ }
+}
+
void PopUpWidget::reflowLayout() {
_leftPadding = g_gui.xmlEval()->getVar("Globals.PopUpWidget.Padding.Left", 0);
_rightPadding = g_gui.xmlEval()->getVar("Globals.PopUpWidget.Padding.Right", 0);