~eliasnaur/gio-patches

Re: [PATCH gio] io/router: add support for ScrollRange

Details
Message ID
<C9IR03I09ILZ.2PVPD8H6EBDYY@themachine>
DKIM signature
pass
Download raw message
On Thu Feb 25, 2021 at 16:54, Pierre Curto wrote:
> > > > > +     if e.focused {
> > > >
> > > > Why make Editor scrollable only when focused?
> > > >
> > >
> > > Because in a vertical List of Editors, how to distinguish where vertical
> > > scrolls should go:
> > > the list or the editor?
> > >
> >
> > Scrolls will be distributed between handlers that contain the pointer,
> > foremost first.
> >
> > Consider a vertical scroll of +50 pixels, and an Editor on top of a List
> > both containing the pointer. Their vertical ranges are,
> >
>
> The router needs to take care of tracking events to determine the amount of
> scrolling right?
>

What do you mean by tracking events? Tracking dragging for touchscreen
scrolling? Scroll ranges only handles explicit scroll events generated
by a mouse (or the OS). I have an idea for how we handle drag scrolling,
but I'd like to fix the explicit events first.

>
> >
> > Editor: [Min: 0, Max: 20]
> > List: [Min: -30, Max: MaxInt]
> >
> > The router then splits the scroll in two, one +20 pixels vertical scroll
> > to the Editor, and one +30 scroll to the List.
> >
> > A vertical scroll of -50 pixels result in a single -30 scroll to the
> > List, discarding the remaining -20 (or List receives all -50 pixels to
> > indicate "overscrolling"). The Editor's receives no scroll event because
> > its vertical min is zero.
> >
>
> I see. So the editor *and* the list would scroll with their respective
> (different) amount.
> I suppose the editor max/min would be based on where in the text the cursor
> is? (number of lines from the start/end).
>

I don't think the text caret position matters for scrolling. Scroll
events move the Editor viewport, not the caret.

Elias
Reply to thread Export thread (mbox)