Skip to content

Auto-scroll when dragging to create range selection in staging view - #5855

Open
stefanhaller wants to merge 4 commits into
gocui-mouse-event-fixesfrom
autoscroll-when-dragging-range-selection-in-staging-view
Open

Auto-scroll when dragging to create range selection in staging view#5855
stefanhaller wants to merge 4 commits into
gocui-mouse-event-fixesfrom
autoscroll-when-dragging-range-selection-in-staging-view

Conversation

@stefanhaller

Copy link
Copy Markdown
Collaborator

The staging view (and custom patch building view) already has the capability to create a range selection by dragging with the mouse; however, a longer range couldn't be selected this way because the dragging stopped at the view edge. Add auto-scrolling so that the view scrolls as the mouse reaches the view edge; slowly on the innermost edge row, faster
on the outermost row and beyond. Scrolling starts after a short delay so that a drag merely passing near the edge doesn't scroll.

@stefanhaller stefanhaller added the enhancement New feature or request label Jul 25, 2026
@stefanhaller
stefanhaller force-pushed the gocui-mouse-event-fixes branch from 7b7d524 to 1362313 Compare July 25, 2026 16:13
@stefanhaller
stefanhaller force-pushed the autoscroll-when-dragging-range-selection-in-staging-view branch from adf5f23 to ce69de0 Compare July 25, 2026 16:14
@stefanhaller
stefanhaller force-pushed the gocui-mouse-event-fixes branch from 1362313 to 398fb1a Compare July 26, 2026 05:57
@stefanhaller
stefanhaller force-pushed the autoscroll-when-dragging-range-selection-in-staging-view branch from ce69de0 to da1e1f0 Compare July 26, 2026 06:02
Add press/move/release primitives next to the existing Click. The test
driver remembers the last reported position so a release doesn't have
to repeat the coordinates, and RepeatMouseMove lets a test verify that
a held-button motion event within the same cell has no effect.
It can be used to auto-scroll a view during drag gestures when the
cursor reaches the edge of the view.
When the pointer reaches the edge of the view during a drag (or leaves
the view entirely, which mouse capture makes possible), keep scrolling
and extending the selection: slowly on the innermost edge row, faster
on the outermost row, and very fast beyond. Scrolling starts after a
short delay so that a drag merely passing near the edge doesn't scroll.

When the view loses focus mid-drag (e.g. because a popup appeared),
cancel the autoscroll and the mouse capture.
@stefanhaller
stefanhaller force-pushed the gocui-mouse-event-fixes branch from 398fb1a to 32b5eb6 Compare July 26, 2026 12:41
@stefanhaller
stefanhaller force-pushed the autoscroll-when-dragging-range-selection-in-staging-view branch from da1e1f0 to 966b3f4 Compare July 26, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant