mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 19:29:16 +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:
committed by
Linus Groh
parent
56a719daf8
commit
12ee92004d
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user