From 5a73bf1553bc669eb3d0a669bf48a62e7ca38429 Mon Sep 17 00:00:00 2001 From: FrHun <28605587+frhun@users.noreply.github.com> Date: Fri, 17 Jun 2022 02:48:23 +0200 Subject: [PATCH] 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. --- Userland/Libraries/LibGUI/Scrollbar.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGUI/Scrollbar.cpp b/Userland/Libraries/LibGUI/Scrollbar.cpp index 39ac9953f8..7ef7fe05d9 100644 --- a/Userland/Libraries/LibGUI/Scrollbar.cpp +++ b/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)