1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 08:28:11 +00:00

LibGUI+LibWeb: Use 'decrease_slider_by_steps()' method

This method allow us to avoid repeating the pattern
'set_value(value() - step() * step_number)'.
This commit is contained in:
Elyse 2021-10-31 12:34:55 -06:00 committed by Andreas Kling
parent cee4e02134
commit 8d1fb299b1
2 changed files with 3 additions and 3 deletions

View file

@ -228,7 +228,7 @@ void Scrollbar::paint_event(PaintEvent& event)
void Scrollbar::on_automatic_scrolling_timer_fired()
{
if (m_pressed_component == Component::DecrementButton && component_at_position(m_last_mouse_position) == Component::DecrementButton) {
set_value(value() - step());
decrease_slider_by_steps(1);
return;
}
if (m_pressed_component == Component::IncrementButton && component_at_position(m_last_mouse_position) == Component::IncrementButton) {