Everywhere: Use 'increase_slider_by()' method from AbstractSlider

This method help us to avoid repeating the pattern
'set_value(value() + delta)'.
This commit is contained in:
Elyse 2021-12-28 21:47:26 -06:00 committed by Andreas Kling
commit d53e1fa1fa
Notes: sideshowbarker 2024-07-17 21:55:29 +09:00
12 changed files with 19 additions and 19 deletions

View file

@ -239,7 +239,7 @@ void RollWidget::mouseup_event([[maybe_unused]] GUI::MouseEvent& event)
void RollWidget::mousewheel_event(GUI::MouseEvent& event)
{
if (event.modifiers() & KeyModifier::Mod_Shift) {
horizontal_scrollbar().set_value(horizontal_scrollbar().value() + (event.wheel_delta() * horizontal_scroll_sensitivity));
horizontal_scrollbar().increase_slider_by(event.wheel_delta() * horizontal_scroll_sensitivity);
return;
}