1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-29 14:25:07 +00:00

LibGUI+Taskbar: Don't immediately repaint checkable Buttons

Unlike regular buttons, unchecked checkables don't need to repaint
on MouseUp to feel responsive when clicking rapidly. In fact, this
can lead to a flickering effect when a bogus unchecked state gets
painted again before the button's checked one.
This commit is contained in:
thankyouverycool 2022-09-04 07:54:54 -04:00 committed by Linus Groh
parent 56a719daf8
commit 12ee92004d

View file

@ -134,6 +134,7 @@ void AbstractButton::mouseup_event(MouseEvent& event)
bool was_being_pressed = m_being_pressed;
m_being_pressed = false;
m_pressed_mouse_button = MouseButton::None;
if (!is_checkable() || is_checked())
repaint();
if (was_being_pressed && !was_auto_repeating) {
switch (event.button()) {