summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/InProcessWebView.cpp
diff options
context:
space:
mode:
authorElyse <kevincristian@outlook.com>2021-10-31 12:34:55 -0600
committerAndreas Kling <kling@serenityos.org>2021-12-30 14:31:50 +0100
commit8d1fb299b1c55d9b2c5a53433e7548f0b0d98a77 (patch)
tree193b9594b51c8e531daef83e2f7074fe44fe7183 /Userland/Libraries/LibWeb/InProcessWebView.cpp
parentcee4e021342e2c38a3a7d44d9dbe81f92ec7c515 (diff)
downloadserenity-8d1fb299b1c55d9b2c5a53433e7548f0b0d98a77.zip
LibGUI+LibWeb: Use 'decrease_slider_by_steps()' method
This method allow us to avoid repeating the pattern 'set_value(value() - step() * step_number)'.
Diffstat (limited to 'Userland/Libraries/LibWeb/InProcessWebView.cpp')
-rw-r--r--Userland/Libraries/LibWeb/InProcessWebView.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/InProcessWebView.cpp b/Userland/Libraries/LibWeb/InProcessWebView.cpp
index 9bcc0062f3..88cf8e9a9a 100644
--- a/Userland/Libraries/LibWeb/InProcessWebView.cpp
+++ b/Userland/Libraries/LibWeb/InProcessWebView.cpp
@@ -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());