mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 02:15:34 +00:00
ui/layout: unexport List.Update and move its parameters to state
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+5
-2
@@ -18,6 +18,8 @@ type scrollChild struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type List struct {
|
type List struct {
|
||||||
|
Config *ui.Config
|
||||||
|
Inputs input.Events
|
||||||
Axis Axis
|
Axis Axis
|
||||||
Invert bool
|
Invert bool
|
||||||
CrossAxisAlignment CrossAxisAlignment
|
CrossAxisAlignment CrossAxisAlignment
|
||||||
@@ -49,6 +51,7 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (l *List) Init(ops *ui.Ops, cs Constraints, len int) {
|
func (l *List) Init(ops *ui.Ops, cs Constraints, len int) {
|
||||||
|
l.update()
|
||||||
l.ops = ops
|
l.ops = ops
|
||||||
l.dir = iterateNone
|
l.dir = iterateNone
|
||||||
l.maxSize = 0
|
l.maxSize = 0
|
||||||
@@ -65,9 +68,9 @@ func (l *List) Dragging() bool {
|
|||||||
return l.scroll.Dragging()
|
return l.scroll.Dragging()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l *List) Update(c *ui.Config, q input.Events) {
|
func (l *List) update() {
|
||||||
l.Distance = 0
|
l.Distance = 0
|
||||||
d := l.scroll.Update(c, q, gesture.Axis(l.Axis))
|
d := l.scroll.Update(l.Config, l.Inputs, gesture.Axis(l.Axis))
|
||||||
if l.Invert {
|
if l.Invert {
|
||||||
d = -d
|
d = -d
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user