mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 10:57:34 +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:
parent
82c06f58af
commit
b79b70f197
1 changed files with 2 additions and 2 deletions
|
@ -209,14 +209,14 @@ void Scrollbar::paint_event(PaintEvent& event)
|
||||||
auto decrement_location = decrement_button_rect().location().translated(3, 3);
|
auto decrement_location = decrement_button_rect().location().translated(3, 3);
|
||||||
if (decrement_pressed)
|
if (decrement_pressed)
|
||||||
decrement_location.translate_by(1, 1);
|
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 + 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());
|
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);
|
auto increment_location = increment_button_rect().location().translated(3, 3);
|
||||||
if (increment_pressed)
|
if (increment_pressed)
|
||||||
increment_location.translate_by(1, 1);
|
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 + 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());
|
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());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue