aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorTorbjörn Andersson2012-12-27 10:37:02 +0100
committerTorbjörn Andersson2012-12-27 10:37:02 +0100
commit5b09c1c8e3dd4ed927e1c6ee670defe83e4382c9 (patch)
tree892e93c38f9104881c9f5c3aa515898daf7fe8bc /gui
parentba182faeaf3158f6bbeec001617f64a954637c9d (diff)
downloadscummvm-rg350-5b09c1c8e3dd4ed927e1c6ee670defe83e4382c9.tar.gz
scummvm-rg350-5b09c1c8e3dd4ed927e1c6ee670defe83e4382c9.tar.bz2
scummvm-rg350-5b09c1c8e3dd4ed927e1c6ee670defe83e4382c9.zip
GUI: Don't allow changing disabled popup widgets with mouse wheel
This was another inconsistency between changing the widget by clicking and changing it with the mouse wheel. Hopefully the last one, though.
Diffstat (limited to 'gui')
-rw-r--r--gui/widgets/popup.cpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/gui/widgets/popup.cpp b/gui/widgets/popup.cpp
index 61d4a54c3f..829a49c53e 100644
--- a/gui/widgets/popup.cpp
+++ b/gui/widgets/popup.cpp
@@ -394,20 +394,22 @@ void PopUpWidget::handleMouseDown(int x, int y, int button, int clickCount) {
}
void PopUpWidget::handleMouseWheel(int x, int y, int direction) {
- int newSelection = _selectedItem + direction;
+ if (isEnabled()) {
+ int newSelection = _selectedItem + direction;
- // Skip separator entries
- while ((newSelection >= 0) && (newSelection < (int)_entries.size()) &&
- _entries[newSelection].name.equals("")) {
- newSelection += 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;
- sendCommand(kPopUpItemSelectedCmd, _entries[_selectedItem].tag);
- draw();
+ // Just update the selected item when we're in range
+ if ((newSelection >= 0) && (newSelection < (int)_entries.size()) &&
+ (newSelection != _selectedItem)) {
+ _selectedItem = newSelection;
+ sendCommand(kPopUpItemSelectedCmd, _entries[_selectedItem].tag);
+ draw();
+ }
}
}