mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-02 16:33:13 +00:00
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:
parent
cee4e02134
commit
8d1fb299b1
Notes:
sideshowbarker
2024-07-17 21:55:16 +09:00
Author: https://github.com/elyse0
Commit: 8d1fb299b1
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 3 additions and 3 deletions
|
@ -257,13 +257,13 @@ void InProcessWebView::keydown_event(GUI::KeyEvent& event)
|
|||
vertical_scrollbar().increase_slider_by_steps(1);
|
||||
break;
|
||||
case Key_Up:
|
||||
vertical_scrollbar().set_value(vertical_scrollbar().value() - vertical_scrollbar().step());
|
||||
vertical_scrollbar().decrease_slider_by_steps(1);
|
||||
break;
|
||||
case Key_Left:
|
||||
horizontal_scrollbar().increase_slider_by_steps(1);
|
||||
break;
|
||||
case Key_Right:
|
||||
horizontal_scrollbar().set_value(horizontal_scrollbar().value() - horizontal_scrollbar().step());
|
||||
horizontal_scrollbar().decrease_slider_by_steps(1);
|
||||
break;
|
||||
case Key_PageDown:
|
||||
vertical_scrollbar().increase_slider_by(frame_inner_rect().height());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue