Ver Fonte

LibGUI: End Scrollbar gutter tinting when target is reached

Before, when holding at a location in the gutter until the scrubber
reached that location, the gutter would stay tinted, even after the
target was reached, and the scrubber didn't move any more; only
stopping when the pointer was moved.
FrHun há 3 anos atrás
pai
commit
5a73bf1553
1 ficheiros alterados com 5 adições e 1 exclusões
  1. 5 1
      Userland/Libraries/LibGUI/Scrollbar.cpp

+ 5 - 1
Userland/Libraries/LibGUI/Scrollbar.cpp

@@ -276,7 +276,11 @@ void Scrollbar::on_automatic_scrolling_timer_fired()
         }
         return;
     }
-    m_gutter_click_state = GutterClickState::NotPressed;
+    if (m_gutter_click_state != GutterClickState::NotPressed) {
+        m_gutter_click_state = GutterClickState::NotPressed;
+        update();
+        return;
+    }
 }
 
 void Scrollbar::mousedown_event(MouseEvent& event)