mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 18:35:34 +00:00
ui/layout: clean up after function scope change
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+2
-6
@@ -98,7 +98,8 @@ func (l *List) init(cfg ui.Config, q input.Queue, ops *ui.Ops, cs Constraints, l
|
||||
// Layout the List and return its dimensions.
|
||||
func (l *List) Layout(c ui.Config, q input.Queue, ops *ui.Ops, cs Constraints, len int, w ListElement) Dimensions {
|
||||
for l.init(c, q, ops, cs, len); l.more(); l.next() {
|
||||
l.end(w(l.constraints(), l.index()))
|
||||
cs := axisConstraints(l.Axis, Constraint{Max: inf}, axisCrossConstraint(l.Axis, l.cs))
|
||||
l.end(w(cs, l.index()))
|
||||
}
|
||||
return l.layout()
|
||||
}
|
||||
@@ -145,11 +146,6 @@ func (l *List) index() int {
|
||||
}
|
||||
}
|
||||
|
||||
// constraints is the constraints for the current child.
|
||||
func (l *List) constraints() Constraints {
|
||||
return axisConstraints(l.Axis, Constraint{Max: inf}, axisCrossConstraint(l.Axis, l.cs))
|
||||
}
|
||||
|
||||
// more reports whether more children are needed.
|
||||
func (l *List) more() bool {
|
||||
return l.dir != iterateNone
|
||||
|
||||
Reference in New Issue
Block a user