mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 18:35:34 +00:00
ui/layout: activate sanity checks for Stack
Added by an earlier change, but not activated. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+4
-6
@@ -56,23 +56,21 @@ func (s *Stack) begin(ops *ui.Ops) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *Stack) Rigid(ops *ui.Ops) Constraints {
|
func (s *Stack) Rigid(ops *ui.Ops) Constraints {
|
||||||
ops.Begin()
|
s.begin(ops)
|
||||||
ui.OpLayer{}.Add(ops)
|
|
||||||
return s.cs
|
return s.cs
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Stack) Expand(ops *ui.Ops) Constraints {
|
func (s *Stack) Expand(ops *ui.Ops) Constraints {
|
||||||
cs := Constraints{
|
s.begin(ops)
|
||||||
|
return Constraints{
|
||||||
Width: Constraint{Min: s.maxSZ.X, Max: s.maxSZ.X},
|
Width: Constraint{Min: s.maxSZ.X, Max: s.maxSZ.X},
|
||||||
Height: Constraint{Min: s.maxSZ.Y, Max: s.maxSZ.Y},
|
Height: Constraint{Min: s.maxSZ.Y, Max: s.maxSZ.Y},
|
||||||
}
|
}
|
||||||
ops.Begin()
|
|
||||||
ui.OpLayer{}.Add(ops)
|
|
||||||
return cs
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Stack) End(ops *ui.Ops, dims Dimens) StackChild {
|
func (s *Stack) End(ops *ui.Ops, dims Dimens) StackChild {
|
||||||
b := ops.End()
|
b := ops.End()
|
||||||
|
s.begun = false
|
||||||
if w := dims.Size.X; w > s.maxSZ.X {
|
if w := dims.Size.X; w > s.maxSZ.X {
|
||||||
s.maxSZ.X = w
|
s.maxSZ.X = w
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user