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
commit 8d1fb299b1
Notes: sideshowbarker 2024-07-17 21:55:16 +09:00
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) {