summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp4
-rw-r--r--Userland/Libraries/LibGUI/AbstractView.cpp4
-rw-r--r--Userland/Libraries/LibGUI/Scrollbar.cpp2
-rw-r--r--Userland/Libraries/LibGUI/Slider.cpp2
-rw-r--r--Userland/Libraries/LibGUI/ValueSlider.cpp4
-rw-r--r--Userland/Libraries/LibVT/TerminalWidget.cpp6
-rw-r--r--Userland/Libraries/LibWeb/InProcessWebView.cpp2
-rw-r--r--Userland/Libraries/LibWeb/OutOfProcessWebView.cpp4
8 files changed, 14 insertions, 14 deletions
diff --git a/Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp b/Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp
index 702079c5e1..963f230c7d 100644
--- a/Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp
+++ b/Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp
@@ -49,9 +49,9 @@ void AbstractScrollableWidget::handle_wheel_event(MouseEvent& event, Widget& eve
}
// FIXME: The wheel delta multiplier should probably come from... somewhere?
if (event.shift() || &event_source == m_horizontal_scrollbar.ptr()) {
- horizontal_scrollbar().set_value(horizontal_scrollbar().value() + event.wheel_delta() * 60);
+ horizontal_scrollbar().increase_slider_by(event.wheel_delta() * 60);
} else {
- vertical_scrollbar().set_value(vertical_scrollbar().value() + event.wheel_delta() * 20);
+ vertical_scrollbar().increase_slider_by(event.wheel_delta() * 20);
}
}
diff --git a/Userland/Libraries/LibGUI/AbstractView.cpp b/Userland/Libraries/LibGUI/AbstractView.cpp
index 1af93ffa35..2b4da3728b 100644
--- a/Userland/Libraries/LibGUI/AbstractView.cpp
+++ b/Userland/Libraries/LibGUI/AbstractView.cpp
@@ -797,8 +797,8 @@ void AbstractView::on_automatic_scrolling_timer_fired()
if (m_automatic_scroll_delta.is_null())
return;
- vertical_scrollbar().set_value(vertical_scrollbar().value() + m_automatic_scroll_delta.y());
- horizontal_scrollbar().set_value(horizontal_scrollbar().value() + m_automatic_scroll_delta.x());
+ vertical_scrollbar().increase_slider_by(m_automatic_scroll_delta.y());
+ horizontal_scrollbar().increase_slider_by(m_automatic_scroll_delta.x());
}
}
diff --git a/Userland/Libraries/LibGUI/Scrollbar.cpp b/Userland/Libraries/LibGUI/Scrollbar.cpp
index b6c108a196..467d68443b 100644
--- a/Userland/Libraries/LibGUI/Scrollbar.cpp
+++ b/Userland/Libraries/LibGUI/Scrollbar.cpp
@@ -332,7 +332,7 @@ void Scrollbar::scroll_by_page(const Gfx::IntPoint& click_position)
set_value(value() - page_increment);
} else {
gutter_click_state = GutterClickState::AfterScrubber;
- set_value(value() + page_increment);
+ increase_slider_by(page_increment);
}
}
diff --git a/Userland/Libraries/LibGUI/Slider.cpp b/Userland/Libraries/LibGUI/Slider.cpp
index 355d407132..70d6f08574 100644
--- a/Userland/Libraries/LibGUI/Slider.cpp
+++ b/Userland/Libraries/LibGUI/Slider.cpp
@@ -149,7 +149,7 @@ void Slider::mousewheel_event(MouseEvent& event)
if (orientation() == Orientation::Horizontal)
set_value(value() - wheel_delta * acceleration_modifier);
else
- set_value(value() + wheel_delta * acceleration_modifier);
+ increase_slider_by(wheel_delta * acceleration_modifier);
Widget::mousewheel_event(event);
}
diff --git a/Userland/Libraries/LibGUI/ValueSlider.cpp b/Userland/Libraries/LibGUI/ValueSlider.cpp
index 64f3cf2f35..854e4f0961 100644
--- a/Userland/Libraries/LibGUI/ValueSlider.cpp
+++ b/Userland/Libraries/LibGUI/ValueSlider.cpp
@@ -46,7 +46,7 @@ ValueSlider::ValueSlider(Gfx::Orientation orientation, String suffix)
m_textbox->on_up_pressed = [&]() {
if (value() < max())
- AbstractSlider::set_value(value() + 1);
+ AbstractSlider::increase_slider_by(1);
m_textbox->set_text(formatted_value());
};
@@ -159,7 +159,7 @@ void ValueSlider::leave_event(Core::Event&)
void ValueSlider::mousewheel_event(MouseEvent& event)
{
if (event.wheel_delta() < 0)
- set_value(value() + 1);
+ increase_slider_by(1);
else
set_value(value() - 1);
}
diff --git a/Userland/Libraries/LibVT/TerminalWidget.cpp b/Userland/Libraries/LibVT/TerminalWidget.cpp
index f1454aa5b1..c271113f30 100644
--- a/Userland/Libraries/LibVT/TerminalWidget.cpp
+++ b/Userland/Libraries/LibVT/TerminalWidget.cpp
@@ -107,7 +107,7 @@ TerminalWidget::TerminalWidget(int ptm_fd, bool automatic_size_policy)
m_auto_scroll_timer->on_timeout = [this] {
if (m_auto_scroll_direction != AutoScrollDirection::None) {
int scroll_amount = m_auto_scroll_direction == AutoScrollDirection::Up ? -1 : 1;
- m_scrollbar->set_value(m_scrollbar->value() + scroll_amount);
+ m_scrollbar->increase_slider_by(scroll_amount);
}
};
m_auto_scroll_timer->start();
@@ -219,7 +219,7 @@ void TerminalWidget::keydown_event(GUI::KeyEvent& event)
return;
}
if (event.key() == KeyCode::Key_PageDown && event.modifiers() == Mod_Shift) {
- m_scrollbar->set_value(m_scrollbar->value() + m_terminal.rows());
+ m_scrollbar->increase_slider_by(m_terminal.rows());
return;
}
if (event.key() == KeyCode::Key_Alt) {
@@ -916,7 +916,7 @@ void TerminalWidget::mousewheel_event(GUI::MouseEvent& event)
if (!is_scrollable())
return;
set_auto_scroll_direction(AutoScrollDirection::None);
- m_scrollbar->set_value(m_scrollbar->value() + event.wheel_delta() * scroll_length());
+ m_scrollbar->increase_slider_by(event.wheel_delta() * scroll_length());
GUI::Frame::mousewheel_event(event);
}
diff --git a/Userland/Libraries/LibWeb/InProcessWebView.cpp b/Userland/Libraries/LibWeb/InProcessWebView.cpp
index dc7361ad12..e0c2b1df8d 100644
--- a/Userland/Libraries/LibWeb/InProcessWebView.cpp
+++ b/Userland/Libraries/LibWeb/InProcessWebView.cpp
@@ -266,7 +266,7 @@ void InProcessWebView::keydown_event(GUI::KeyEvent& event)
horizontal_scrollbar().set_value(horizontal_scrollbar().value() - horizontal_scrollbar().step());
break;
case Key_PageDown:
- vertical_scrollbar().set_value(vertical_scrollbar().value() + frame_inner_rect().height());
+ vertical_scrollbar().increase_slider_by(frame_inner_rect().height());
break;
case Key_PageUp:
vertical_scrollbar().set_value(vertical_scrollbar().value() - frame_inner_rect().height());
diff --git a/Userland/Libraries/LibWeb/OutOfProcessWebView.cpp b/Userland/Libraries/LibWeb/OutOfProcessWebView.cpp
index 3e418e5881..a3aa229c22 100644
--- a/Userland/Libraries/LibWeb/OutOfProcessWebView.cpp
+++ b/Userland/Libraries/LibWeb/OutOfProcessWebView.cpp
@@ -243,8 +243,8 @@ void OutOfProcessWebView::notify_server_did_change_title(Badge<WebContentClient>
void OutOfProcessWebView::notify_server_did_request_scroll(Badge<WebContentClient>, i32 x_delta, i32 y_delta)
{
- horizontal_scrollbar().set_value(horizontal_scrollbar().value() + x_delta);
- vertical_scrollbar().set_value(vertical_scrollbar().value() + y_delta);
+ horizontal_scrollbar().increase_slider_by(x_delta);
+ vertical_scrollbar().increase_slider_by(y_delta);
}
void OutOfProcessWebView::notify_server_did_request_scroll_to(Badge<WebContentClient>, Gfx::IntPoint const& scroll_position)