mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 13:02:09 +02:00
LibGUI+LibWeb: Use 'increase_slider_by_steps()' method
This method allow us to avoid repeating the pattern 'set_value(value() + step() * step_number)'.
This commit is contained in:
Notes:
sideshowbarker
2024-07-17 21:55:20 +09:00
Author: https://github.com/elyse0 Commit: https://github.com/SerenityOS/serenity/commit/cee4e021342 Pull-request: https://github.com/SerenityOS/serenity/pull/11163 Reviewed-by: https://github.com/kleinesfilmroellchen ✅ Reviewed-by: https://github.com/metmo ✅
@@ -254,13 +254,13 @@ void InProcessWebView::keydown_event(GUI::KeyEvent& event)
|
||||
vertical_scrollbar().set_value(vertical_scrollbar().max());
|
||||
break;
|
||||
case Key_Down:
|
||||
vertical_scrollbar().set_value(vertical_scrollbar().value() + vertical_scrollbar().step());
|
||||
vertical_scrollbar().increase_slider_by_steps(1);
|
||||
break;
|
||||
case Key_Up:
|
||||
vertical_scrollbar().set_value(vertical_scrollbar().value() - vertical_scrollbar().step());
|
||||
break;
|
||||
case Key_Left:
|
||||
horizontal_scrollbar().set_value(horizontal_scrollbar().value() + horizontal_scrollbar().step());
|
||||
horizontal_scrollbar().increase_slider_by_steps(1);
|
||||
break;
|
||||
case Key_Right:
|
||||
horizontal_scrollbar().set_value(horizontal_scrollbar().value() - horizontal_scrollbar().step());
|
||||
|
||||
Reference in New Issue
Block a user