mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-22 23:55:12 +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:
committed by
Andreas Kling
parent
486775f9fe
commit
4d090487ac
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user