From b79b70f197efcbcb76cebeabc445faa5d73377c2 Mon Sep 17 00:00:00 2001 From: thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> Date: Sun, 2 Apr 2023 13:26:18 -0400 Subject: [PATCH] LibGUI: Paint Scrollbar buttons with appropriate thread highlighting Similar to increment/decrement buttons on SpinBoxes, Scrollbar buttons now draw with the correct highlights after reaching their min or max. --- Userland/Libraries/LibGUI/Scrollbar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibGUI/Scrollbar.cpp b/Userland/Libraries/LibGUI/Scrollbar.cpp index 7797b0c572b..b1d996e9595 100644 --- a/Userland/Libraries/LibGUI/Scrollbar.cpp +++ b/Userland/Libraries/LibGUI/Scrollbar.cpp @@ -209,14 +209,14 @@ void Scrollbar::paint_event(PaintEvent& event) auto decrement_location = decrement_button_rect().location().translated(3, 3); if (decrement_pressed) decrement_location.translate_by(1, 1); - if (!has_scrubber() || !is_enabled()) + if (!has_scrubber() || !is_enabled() || is_min()) painter.draw_triangle(decrement_location + Gfx::IntPoint { 1, 1 }, orientation() == Orientation::Vertical ? s_up_arrow_coords : s_left_arrow_coords, palette().threed_highlight()); painter.draw_triangle(decrement_location, orientation() == Orientation::Vertical ? s_up_arrow_coords : s_left_arrow_coords, (has_scrubber() && is_enabled() && !is_min()) ? palette().button_text() : palette().threed_shadow1()); auto increment_location = increment_button_rect().location().translated(3, 3); if (increment_pressed) increment_location.translate_by(1, 1); - if (!has_scrubber() || !is_enabled()) + if (!has_scrubber() || !is_enabled() || is_max()) painter.draw_triangle(increment_location + Gfx::IntPoint { 1, 1 }, orientation() == Orientation::Vertical ? s_down_arrow_coords : s_right_arrow_coords, palette().threed_highlight()); painter.draw_triangle(increment_location, orientation() == Orientation::Vertical ? s_down_arrow_coords : s_right_arrow_coords, (has_scrubber() && is_enabled() && !is_max()) ? palette().button_text() : palette().threed_shadow1()); }