mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb: Enable middle mouse autoscroll on middle mouse clicks
We previously supported autoscroll while the middle mouse button was pressed. We now also support clicking the middle mouse button in-place to begin autoscroll. Pressing any mouse button or the escape key will exit this mode.
This commit is contained in:
Notes:
github-actions[bot]
2026-04-15 17:38:48 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/331815f3277 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8928
@@ -22,18 +22,18 @@ public:
|
||||
|
||||
static GC::Ptr<DOM::Element> find_scrollable_ancestor(DOM::Document&, Painting::Paintable&);
|
||||
|
||||
void update_mouse_position(CSSPixelPoint);
|
||||
void update_mouse_position(CSSPixelPoint position) { m_mouse_position = position; }
|
||||
void perform_tick();
|
||||
|
||||
CSSPixelPoint origin() const { return m_origin; }
|
||||
bool mouse_has_moved() const { return m_mouse_has_moved; }
|
||||
bool mouse_has_moved_beyond_dead_zone() const { return m_mouse_has_moved_beyond_dead_zone; }
|
||||
|
||||
private:
|
||||
GC::Ref<DOM::Element> m_container_element;
|
||||
CSSPixelPoint m_origin;
|
||||
CSSPixelPoint m_mouse_position;
|
||||
CSSPixelPoint m_fractional_delta;
|
||||
bool m_mouse_has_moved { false };
|
||||
bool m_mouse_has_moved_beyond_dead_zone { false };
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user