mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-03 00:16:15 +00:00
ui/layout: delete List.Distance field
Distance was meant to be used for implementing nested scrollers, but I don't think the API is right. For example, Distance doesn't report residual fling scrolling. Delete the field while we wait for a better approach. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -28,10 +28,6 @@ type List struct {
|
||||
// Alignment is the cross axis alignment of list elements.
|
||||
Alignment Alignment
|
||||
|
||||
// Distance is the difference in scroll position
|
||||
// since the last call to Init.
|
||||
Distance int
|
||||
|
||||
// beforeEnd tracks whether the List position is before
|
||||
// the very end.
|
||||
beforeEnd bool
|
||||
@@ -106,10 +102,8 @@ func (l *List) Dragging() bool {
|
||||
}
|
||||
|
||||
func (l *List) update() {
|
||||
l.Distance = 0
|
||||
d := l.scroll.Scroll(l.config, l.queue, gesture.Axis(l.Axis))
|
||||
l.scrollDelta = d
|
||||
l.Distance += d
|
||||
l.offset += d
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user