mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-11 19:54:03 +00:00
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.
This commit is contained in:
parent
ba182faeaf
commit
5b09c1c8e3
@ -394,20 +394,22 @@ void PopUpWidget::handleMouseDown(int x, int y, int button, int clickCount) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PopUpWidget::handleMouseWheel(int x, int y, int direction) {
|
void PopUpWidget::handleMouseWheel(int x, int y, int direction) {
|
||||||
int newSelection = _selectedItem + direction;
|
if (isEnabled()) {
|
||||||
|
int newSelection = _selectedItem + direction;
|
||||||
|
|
||||||
// Skip separator entries
|
// Skip separator entries
|
||||||
while ((newSelection >= 0) && (newSelection < (int)_entries.size()) &&
|
while ((newSelection >= 0) && (newSelection < (int)_entries.size()) &&
|
||||||
_entries[newSelection].name.equals("")) {
|
_entries[newSelection].name.equals("")) {
|
||||||
newSelection += direction;
|
newSelection += direction;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Just update the selected item when we're in range
|
// Just update the selected item when we're in range
|
||||||
if ((newSelection >= 0) && (newSelection < (int)_entries.size()) &&
|
if ((newSelection >= 0) && (newSelection < (int)_entries.size()) &&
|
||||||
(newSelection != _selectedItem)) {
|
(newSelection != _selectedItem)) {
|
||||||
_selectedItem = newSelection;
|
_selectedItem = newSelection;
|
||||||
sendCommand(kPopUpItemSelectedCmd, _entries[_selectedItem].tag);
|
sendCommand(kPopUpItemSelectedCmd, _entries[_selectedItem].tag);
|
||||||
draw();
|
draw();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user