From 26abb691d8dd2551210cd9970b42ca2df7e9c8af Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 30 Dec 2020 16:08:04 +0100 Subject: [PATCH] LibGUI: Make disabled scrollbars have more disabled looking icons Draw a threed drop highlight under the arrows on disabled scrollbars. This makes it more visible that they are disabled. --- Libraries/LibGUI/ScrollBar.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Libraries/LibGUI/ScrollBar.cpp b/Libraries/LibGUI/ScrollBar.cpp index 4a0c46e3f5..93da0c3d62 100644 --- a/Libraries/LibGUI/ScrollBar.cpp +++ b/Libraries/LibGUI/ScrollBar.cpp @@ -220,12 +220,16 @@ void ScrollBar::paint_event(PaintEvent& event) auto decrement_location = decrement_button_rect().location().translated(3, 3); if (decrement_pressed) decrement_location.move_by(1, 1); - painter.draw_bitmap(decrement_location, orientation() == Orientation::Vertical ? *s_up_arrow_bitmap : *s_left_arrow_bitmap, has_scrubber() ? palette().button_text() : palette().threed_shadow1()); + if (!has_scrubber() || !is_enabled()) + painter.draw_bitmap(decrement_location.translated(1, 1), orientation() == Orientation::Vertical ? *s_up_arrow_bitmap : *s_left_arrow_bitmap, palette().threed_highlight()); + painter.draw_bitmap(decrement_location, orientation() == Orientation::Vertical ? *s_up_arrow_bitmap : *s_left_arrow_bitmap, (has_scrubber() && is_enabled()) ? palette().button_text() : palette().threed_shadow1()); auto increment_location = increment_button_rect().location().translated(3, 3); if (increment_pressed) increment_location.move_by(1, 1); - painter.draw_bitmap(increment_location, orientation() == Orientation::Vertical ? *s_down_arrow_bitmap : *s_right_arrow_bitmap, has_scrubber() ? palette().button_text() : palette().threed_shadow1()); + if (!has_scrubber() || !is_enabled()) + painter.draw_bitmap(increment_location.translated(1, 1), orientation() == Orientation::Vertical ? *s_down_arrow_bitmap : *s_right_arrow_bitmap, palette().threed_highlight()); + painter.draw_bitmap(increment_location, orientation() == Orientation::Vertical ? *s_down_arrow_bitmap : *s_right_arrow_bitmap, (has_scrubber() && is_enabled()) ? palette().button_text() : palette().threed_shadow1()); } if (has_scrubber())