mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-03 17:33:05 +00:00
GUI: Fix unpressed state of checkboxes and radio buttons
Clicking on a checkbox (and, presumably, a radio button) would leave it in the "pressed" state, which would inhibit tooltips for it. Now the unpressed state is cleared along with _duringPress for both these classes. There are other widgets that inherit from ButtonWidget, but they either already did this, or didn't override handleMouseUp(), so they should be fine.
This commit is contained in:
parent
719ea5b72c
commit
d057880f92
@ -691,6 +691,7 @@ void CheckboxWidget::handleMouseUp(int x, int y, int button, int clickCount) {
|
||||
if (isEnabled() && _duringPress && x >= 0 && x < _w && y >= 0 && y < _h) {
|
||||
toggleState();
|
||||
}
|
||||
setUnpressedState();
|
||||
_duringPress = false;
|
||||
}
|
||||
|
||||
@ -757,6 +758,7 @@ void RadiobuttonWidget::handleMouseUp(int x, int y, int button, int clickCount)
|
||||
if (isEnabled() && _duringPress && x >= 0 && x < _w && y >= 0 && y < _h) {
|
||||
toggleState();
|
||||
}
|
||||
setUnpressedState();
|
||||
_duringPress = false;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user