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:
Elias Naur
2019-09-05 20:41:09 +02:00
parent 1529f20eb7
commit 7d93a2790c
-6
View File
@@ -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
}