mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02: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:
Notes:
sideshowbarker
2024-07-17 21:55:16 +09:00
Author: https://github.com/elyse0 Commit: https://github.com/SerenityOS/serenity/commit/8d1fb299b1c Pull-request: https://github.com/SerenityOS/serenity/pull/11163 Reviewed-by: https://github.com/kleinesfilmroellchen ✅ Reviewed-by: https://github.com/metmo ✅
@@ -228,7 +228,7 @@ void Scrollbar::paint_event(PaintEvent& event)
|
||||
void Scrollbar::on_automatic_scrolling_timer_fired()
|
||||
{
|
||||
if (m_pressed_component == Component::DecrementButton && component_at_position(m_last_mouse_position) == Component::DecrementButton) {
|
||||
set_value(value() - step());
|
||||
decrease_slider_by_steps(1);
|
||||
return;
|
||||
}
|
||||
if (m_pressed_component == Component::IncrementButton && component_at_position(m_last_mouse_position) == Component::IncrementButton) {
|
||||
|
||||
Reference in New Issue
Block a user