mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-18 09:02:53 +00: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:
parent
086615535f
commit
cee4e02134
Notes:
sideshowbarker
2024-07-17 21:55:20 +09:00
Author: https://github.com/elyse0
Commit: cee4e02134
Pull-request: https://github.com/SerenityOS/serenity/pull/11163
Reviewed-by: https://github.com/kleinesfilmroellchen ✅
Reviewed-by: https://github.com/metmo ✅
2 changed files with 4 additions and 4 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue