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
commit 12ee92004d
Notes: sideshowbarker 2024-07-17 07:21:45 +09:00

View file

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