mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:27:43 +00:00
LibGUI: Stop auto repeat timer for Buttons on EnabledChange events
Since 5064b58
SpinBox buttons are disabled if value reaches the
min or max allowed. Consequently this swallows the final MouseUp
event, leaving the repeat timer running. Fixes SpinBoxes
{dec,inc}rementing their value in perpetuity after min/max value
is reached through button clicking.
This commit is contained in:
parent
486775f9fe
commit
4d090487ac
1 changed files with 2 additions and 0 deletions
|
@ -249,6 +249,8 @@ void AbstractButton::paint_text(Painter& painter, Gfx::IntRect const& rect, Gfx:
|
|||
void AbstractButton::change_event(Event& event)
|
||||
{
|
||||
if (event.type() == Event::Type::EnabledChange) {
|
||||
if (m_auto_repeat_timer->is_active())
|
||||
m_auto_repeat_timer->stop();
|
||||
if (!is_enabled()) {
|
||||
bool was_being_pressed = m_being_pressed;
|
||||
m_being_pressed = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue