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:
Elias Naur
2019-06-02 15:08:49 +02:00
parent b55a02f597
commit 1c880f2b9d
+4 -6
View File
@@ -56,23 +56,21 @@ func (s *Stack) begin(ops *ui.Ops) {
}
func (s *Stack) Rigid(ops *ui.Ops) Constraints {
ops.Begin()
ui.OpLayer{}.Add(ops)
s.begin(ops)
return s.cs
}
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},
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 {
b := ops.End()
s.begun = false
if w := dims.Size.X; w > s.maxSZ.X {
s.maxSZ.X = w
}