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
1 changed files with 2 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue