mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 15:45:25 +00:00
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.
This commit is contained in:
committed by
Andreas Kling
parent
82c06f58af
commit
b79b70f197
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user