summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorthankyouverycool <66646555+thankyouverycool@users.noreply.github.com>2020-07-16 17:12:19 -0400
committerAndreas Kling <kling@serenityos.org>2020-07-18 16:27:57 +0200
commitd976b31ef618073db851caf468b5b63076b9658c (patch)
treeb7b84f42a00a25fdbb3888f233c3b1894f9d2d59 /Libraries
parent19e883e45aaf88f40cc5a1b51ed5209f83bcc852 (diff)
downloadserenity-d976b31ef618073db851caf468b5b63076b9658c.zip
LibGUI: Paint slider knob as indented when disabled
Better visual feedback when sliders won't budge.
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibGUI/Slider.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/Libraries/LibGUI/Slider.cpp b/Libraries/LibGUI/Slider.cpp
index e55cb61fa4..08b8fb5575 100644
--- a/Libraries/LibGUI/Slider.cpp
+++ b/Libraries/LibGUI/Slider.cpp
@@ -79,9 +79,11 @@ void Slider::paint_event(PaintEvent& event)
track_rect = { 0, inner_rect().y(), track_size(), inner_rect().height() };
track_rect.center_horizontally_within(inner_rect());
}
-
Gfx::StylePainter::paint_frame(painter, track_rect, palette(), Gfx::FrameShape::Panel, Gfx::FrameShadow::Sunken, 1);
- Gfx::StylePainter::paint_button(painter, knob_rect(), palette(), Gfx::ButtonStyle::Normal, false, m_knob_hovered);
+ if (is_enabled())
+ Gfx::StylePainter::paint_button(painter, knob_rect(), palette(), Gfx::ButtonStyle::Normal, false, m_knob_hovered);
+ else
+ Gfx::StylePainter::paint_button(painter, knob_rect(), palette(), Gfx::ButtonStyle::Normal, true, m_knob_hovered);
}
Gfx::IntRect Slider::knob_rect() const