summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI
diff options
context:
space:
mode:
authorJelle Raaijmakers <jelle@gmta.nl>2021-04-10 22:06:19 +0200
committerAndreas Kling <kling@serenityos.org>2021-04-10 22:28:00 +0200
commit06353077b75f4210c8678e5dff3ffb7a61c5ff4e (patch)
treeb069f99ae39a871adbc14d6988294f22dd643b7c /Userland/Libraries/LibGUI
parent1d7bec0fe74abc3694df5789746d559a23b44588 (diff)
downloadserenity-06353077b75f4210c8678e5dff3ffb7a61c5ff4e.zip
LibGUI/ScrollBar: Only paint buttons as pressed when also hovered
Fixes #6185
Diffstat (limited to 'Userland/Libraries/LibGUI')
-rw-r--r--Userland/Libraries/LibGUI/ScrollBar.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibGUI/ScrollBar.cpp b/Userland/Libraries/LibGUI/ScrollBar.cpp
index 26b6816b4d..7216df5a38 100644
--- a/Userland/Libraries/LibGUI/ScrollBar.cpp
+++ b/Userland/Libraries/LibGUI/ScrollBar.cpp
@@ -212,8 +212,8 @@ void ScrollBar::paint_event(PaintEvent& event)
painter.fill_rect_with_dither_pattern(rect(), palette().button().lightened(1.3f), palette().button());
- bool decrement_pressed = m_pressed_component == Component::DecrementButton;
- bool increment_pressed = m_pressed_component == Component::IncrementButton;
+ bool decrement_pressed = (m_pressed_component == Component::DecrementButton) && (m_pressed_component == m_hovered_component);
+ bool increment_pressed = (m_pressed_component == Component::IncrementButton) && (m_pressed_component == m_hovered_component);
Gfx::StylePainter::paint_button(painter, decrement_button_rect(), palette(), Gfx::ButtonStyle::Normal, decrement_pressed, hovered_component_for_painting == Component::DecrementButton);
Gfx::StylePainter::paint_button(painter, increment_button_rect(), palette(), Gfx::ButtonStyle::Normal, increment_pressed, hovered_component_for_painting == Component::IncrementButton);