diff --git a/Userland/Applications/PixelPaint/LayerListWidget.cpp b/Userland/Applications/PixelPaint/LayerListWidget.cpp index e4228fdfd2..1e41f1faa7 100644 --- a/Userland/Applications/PixelPaint/LayerListWidget.cpp +++ b/Userland/Applications/PixelPaint/LayerListWidget.cpp @@ -287,7 +287,7 @@ void LayerListWidget::mousemove_event(GUI::MouseEvent& event) gadget.movement_delta.set_y(inner_rect_max_height - gadget.rect.bottom()); m_automatic_scroll_delta = automatic_scroll_delta_from_position(event.position()); - set_automatic_scrolling_timer(vertical_scrollbar().is_scrollable() && !m_automatic_scroll_delta.is_null()); + set_automatic_scrolling_timer_active(vertical_scrollbar().is_scrollable() && !m_automatic_scroll_delta.is_null()); relayout_gadgets(); } @@ -307,7 +307,7 @@ void LayerListWidget::mouseup_event(GUI::MouseEvent& event) new_index = m_image->layer_count() - 1; m_moving_gadget_index = {}; - set_automatic_scrolling_timer(false); + set_automatic_scrolling_timer_active(false); auto old_layer_index = to_layer_index(old_index); auto new_layer_index = to_layer_index(new_index); @@ -329,7 +329,7 @@ void LayerListWidget::context_menu_event(GUI::ContextMenuEvent& event) on_context_menu_request(event); } -void LayerListWidget::on_automatic_scrolling_timer_fired() +void LayerListWidget::automatic_scrolling_timer_did_fire() { auto& gadget = m_gadgets[m_moving_gadget_index.value()]; VERIFY(gadget.is_moving); diff --git a/Userland/Applications/PixelPaint/LayerListWidget.h b/Userland/Applications/PixelPaint/LayerListWidget.h index 9966dd3e4f..4a1ccdbf38 100644 --- a/Userland/Applications/PixelPaint/LayerListWidget.h +++ b/Userland/Applications/PixelPaint/LayerListWidget.h @@ -46,7 +46,7 @@ private: virtual void image_did_modify_layer_properties(size_t) override; virtual void image_did_modify_layer_bitmap(size_t) override; virtual void image_did_modify_layer_stack() override; - virtual void on_automatic_scrolling_timer_fired() override; + virtual void automatic_scrolling_timer_did_fire() override; void rebuild_gadgets(); void relayout_gadgets(); diff --git a/Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp b/Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp index 340136a31e..bb83b024f7 100644 --- a/Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp +++ b/Userland/Libraries/LibGUI/AbstractScrollableWidget.cpp @@ -36,7 +36,7 @@ AbstractScrollableWidget::AbstractScrollableWidget() m_automatic_scrolling_timer = add(); m_automatic_scrolling_timer->set_interval(50); m_automatic_scrolling_timer->on_timeout = [this] { - on_automatic_scrolling_timer_fired(); + automatic_scrolling_timer_did_fire(); }; } @@ -303,7 +303,7 @@ void AbstractScrollableWidget::scroll_to_bottom() scroll_into_view({ 0, content_height(), 0, 0 }, Orientation::Vertical); } -void AbstractScrollableWidget::set_automatic_scrolling_timer(bool active) +void AbstractScrollableWidget::set_automatic_scrolling_timer_active(bool active) { if (active == m_active_scrolling_enabled) return; @@ -311,7 +311,7 @@ void AbstractScrollableWidget::set_automatic_scrolling_timer(bool active) m_active_scrolling_enabled = active; if (active) { - on_automatic_scrolling_timer_fired(); + automatic_scrolling_timer_did_fire(); m_automatic_scrolling_timer->start(); } else { m_automatic_scrolling_timer->stop(); diff --git a/Userland/Libraries/LibGUI/AbstractScrollableWidget.h b/Userland/Libraries/LibGUI/AbstractScrollableWidget.h index d35113d9cc..a3368ac6af 100644 --- a/Userland/Libraries/LibGUI/AbstractScrollableWidget.h +++ b/Userland/Libraries/LibGUI/AbstractScrollableWidget.h @@ -58,7 +58,7 @@ public: void scroll_to_bottom(); void update_scrollbar_ranges(); - void set_automatic_scrolling_timer(bool active); + void set_automatic_scrolling_timer_active(bool); virtual Gfx::IntPoint automatic_scroll_delta_from_position(Gfx::IntPoint) const; int width_occupied_by_vertical_scrollbar() const; @@ -84,10 +84,10 @@ protected: virtual void resize_event(ResizeEvent&) override; virtual void mousewheel_event(MouseEvent&) override; virtual void did_scroll() { } + virtual void automatic_scrolling_timer_did_fire() {}; void set_content_size(Gfx::IntSize); void set_min_content_size(Gfx::IntSize); void set_size_occupied_by_fixed_elements(Gfx::IntSize); - virtual void on_automatic_scrolling_timer_fired() {}; int autoscroll_threshold() const { return m_autoscroll_threshold; } void update_scrollbar_visibility(); diff --git a/Userland/Libraries/LibGUI/AbstractView.cpp b/Userland/Libraries/LibGUI/AbstractView.cpp index 384bb084eb..ec95d5f2b6 100644 --- a/Userland/Libraries/LibGUI/AbstractView.cpp +++ b/Userland/Libraries/LibGUI/AbstractView.cpp @@ -351,7 +351,7 @@ void AbstractView::mouseup_event(MouseEvent& event) if (!model()) return; - set_automatic_scrolling_timer(false); + set_automatic_scrolling_timer_active(false); if (m_might_drag) { // We were unsure about unselecting items other than the current one @@ -796,7 +796,7 @@ void AbstractView::drag_move_event(DragEvent& event) if (acceptable) { m_automatic_scroll_delta = automatic_scroll_delta_from_position(event.position()); - set_automatic_scrolling_timer(!m_automatic_scroll_delta.is_null()); + set_automatic_scrolling_timer_active(!m_automatic_scroll_delta.is_null()); } if (m_drop_candidate_index != new_drop_candidate_index) { @@ -814,10 +814,10 @@ void AbstractView::drag_leave_event(Event&) update(); } - set_automatic_scrolling_timer(false); + set_automatic_scrolling_timer_active(false); } -void AbstractView::on_automatic_scrolling_timer_fired() +void AbstractView::automatic_scrolling_timer_did_fire() { if (m_automatic_scroll_delta.is_null()) return; diff --git a/Userland/Libraries/LibGUI/AbstractView.h b/Userland/Libraries/LibGUI/AbstractView.h index d855456582..38860be327 100644 --- a/Userland/Libraries/LibGUI/AbstractView.h +++ b/Userland/Libraries/LibGUI/AbstractView.h @@ -148,7 +148,7 @@ protected: virtual void hide_event(HideEvent&) override; virtual void focusin_event(FocusEvent&) override; - virtual void on_automatic_scrolling_timer_fired() override; + virtual void automatic_scrolling_timer_did_fire() override; virtual void clear_selection(); virtual void set_selection(ModelIndex const&); diff --git a/Userland/Libraries/LibGUI/IconView.cpp b/Userland/Libraries/LibGUI/IconView.cpp index ad19bafc2c..fe18cca72b 100644 --- a/Userland/Libraries/LibGUI/IconView.cpp +++ b/Userland/Libraries/LibGUI/IconView.cpp @@ -238,7 +238,7 @@ void IconView::mouseup_event(MouseEvent& event) { if (m_rubber_banding && event.button() == MouseButton::Primary) { m_rubber_banding = false; - set_automatic_scrolling_timer(false); + set_automatic_scrolling_timer_active(false); update(to_widget_rect(Gfx::IntRect::from_two_points(m_rubber_band_origin, m_rubber_band_current))); } AbstractView::mouseup_event(event); @@ -329,7 +329,7 @@ void IconView::mousemove_event(MouseEvent& event) if (m_rubber_banding) { m_out_of_view_position = event.position(); - set_automatic_scrolling_timer(!m_rubber_band_scroll_delta.is_null()); + set_automatic_scrolling_timer_active(!m_rubber_band_scroll_delta.is_null()); if (update_rubber_banding(event.position())) return; @@ -338,9 +338,9 @@ void IconView::mousemove_event(MouseEvent& event) AbstractView::mousemove_event(event); } -void IconView::on_automatic_scrolling_timer_fired() +void IconView::automatic_scrolling_timer_did_fire() { - AbstractView::on_automatic_scrolling_timer_fired(); + AbstractView::automatic_scrolling_timer_did_fire(); if (m_rubber_band_scroll_delta.is_null()) return; diff --git a/Userland/Libraries/LibGUI/IconView.h b/Userland/Libraries/LibGUI/IconView.h index 8a729d12a1..c02c9b680e 100644 --- a/Userland/Libraries/LibGUI/IconView.h +++ b/Userland/Libraries/LibGUI/IconView.h @@ -62,7 +62,7 @@ private: virtual void move_cursor(CursorMovement, SelectionUpdate) override; - virtual void on_automatic_scrolling_timer_fired() override; + virtual void automatic_scrolling_timer_did_fire() override; struct ItemData { Gfx::IntRect text_rect; diff --git a/Userland/Libraries/LibGUI/Scrollbar.cpp b/Userland/Libraries/LibGUI/Scrollbar.cpp index c38065522b..7fcdab5f47 100644 --- a/Userland/Libraries/LibGUI/Scrollbar.cpp +++ b/Userland/Libraries/LibGUI/Scrollbar.cpp @@ -53,7 +53,7 @@ Scrollbar::Scrollbar(Orientation orientation) m_automatic_scrolling_timer->set_interval(100); m_automatic_scrolling_timer->on_timeout = [this] { - on_automatic_scrolling_timer_fired(); + automatic_scrolling_timer_did_fire(); }; } @@ -225,7 +225,7 @@ void Scrollbar::paint_event(PaintEvent& event) Gfx::StylePainter::paint_button(painter, scrubber_rect(), palette(), Gfx::ButtonStyle::ThickCap, false, hovered_component_for_painting == Component::Scrubber || m_pressed_component == Component::Scrubber); } -void Scrollbar::on_automatic_scrolling_timer_fired() +void Scrollbar::automatic_scrolling_timer_did_fire() { if (m_pressed_component == Component::DecrementButton && component_at_position(m_last_mouse_position) == Component::DecrementButton) { decrease_slider_by_steps(1); @@ -265,14 +265,14 @@ void Scrollbar::mousedown_event(MouseEvent& event) if (m_pressed_component == Component::DecrementButton) { if (is_min()) return; - set_automatic_scrolling_active(true, Component::DecrementButton); + set_automatic_scrolling_timer_active(true, Component::DecrementButton); update(); return; } if (m_pressed_component == Component::IncrementButton) { if (is_max()) return; - set_automatic_scrolling_active(true, Component::IncrementButton); + set_automatic_scrolling_timer_active(true, Component::IncrementButton); update(); return; } @@ -291,7 +291,7 @@ void Scrollbar::mousedown_event(MouseEvent& event) VERIFY(!event.shift()); VERIFY(m_pressed_component == Component::Gutter); - set_automatic_scrolling_active(true, Component::Gutter); + set_automatic_scrolling_timer_active(true, Component::Gutter); update(); } @@ -299,7 +299,7 @@ void Scrollbar::mouseup_event(MouseEvent& event) { if (event.button() != MouseButton::Primary) return; - set_automatic_scrolling_active(false, Component::None); + set_automatic_scrolling_timer_active(false, Component::None); update(); } @@ -311,7 +311,7 @@ void Scrollbar::mousewheel_event(MouseEvent& event) Widget::mousewheel_event(event); } -void Scrollbar::set_automatic_scrolling_active(bool active, Component pressed_component) +void Scrollbar::set_automatic_scrolling_timer_active(bool active, Component pressed_component) { m_pressed_component = pressed_component; if (m_pressed_component == Component::Gutter) @@ -320,7 +320,7 @@ void Scrollbar::set_automatic_scrolling_active(bool active, Component pressed_co m_automatic_scrolling_timer->set_interval(100); if (active) { - on_automatic_scrolling_timer_fired(); + automatic_scrolling_timer_did_fire(); m_automatic_scrolling_timer->start(); } else { m_automatic_scrolling_timer->stop(); @@ -402,7 +402,7 @@ void Scrollbar::change_event(Event& event) { if (event.type() == Event::Type::EnabledChange) { if (!is_enabled()) - set_automatic_scrolling_active(false, Component::None); + set_automatic_scrolling_timer_active(false, Component::None); } return Widget::change_event(event); } diff --git a/Userland/Libraries/LibGUI/Scrollbar.h b/Userland/Libraries/LibGUI/Scrollbar.h index 2169d0dcde..de5661bdf5 100644 --- a/Userland/Libraries/LibGUI/Scrollbar.h +++ b/Userland/Libraries/LibGUI/Scrollbar.h @@ -79,8 +79,8 @@ private: float unclamped_scrubber_size() const; int visible_scrubber_size() const; int scrubbable_range_in_pixels() const; - void on_automatic_scrolling_timer_fired(); - void set_automatic_scrolling_active(bool, Component); + void automatic_scrolling_timer_did_fire(); + void set_automatic_scrolling_timer_active(bool, Component); void scroll_to_position(Gfx::IntPoint); void scroll_by_page(Gfx::IntPoint);