From 8d1fb299b1c55d9b2c5a53433e7548f0b0d98a77 Mon Sep 17 00:00:00 2001 From: Elyse Date: Sun, 31 Oct 2021 12:34:55 -0600 Subject: LibGUI+LibWeb: Use 'decrease_slider_by_steps()' method This method allow us to avoid repeating the pattern 'set_value(value() - step() * step_number)'. --- Userland/Libraries/LibWeb/InProcessWebView.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Userland/Libraries/LibWeb/InProcessWebView.cpp') 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()); -- cgit v1.2.3