mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:48:11 +00:00
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:
parent
8b8f404146
commit
d53e1fa1fa
12 changed files with 19 additions and 19 deletions
|
@ -49,9 +49,9 @@ void AbstractScrollableWidget::handle_wheel_event(MouseEvent& event, Widget& eve
|
|||
}
|
||||
// FIXME: The wheel delta multiplier should probably come from... somewhere?
|
||||
if (event.shift() || &event_source == m_horizontal_scrollbar.ptr()) {
|
||||
horizontal_scrollbar().set_value(horizontal_scrollbar().value() + event.wheel_delta() * 60);
|
||||
horizontal_scrollbar().increase_slider_by(event.wheel_delta() * 60);
|
||||
} else {
|
||||
vertical_scrollbar().set_value(vertical_scrollbar().value() + event.wheel_delta() * 20);
|
||||
vertical_scrollbar().increase_slider_by(event.wheel_delta() * 20);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue