diff --git a/layout/format.go b/layout/format.go index d3dd4063..52ea5627 100644 --- a/layout/format.go +++ b/layout/format.go @@ -47,7 +47,7 @@ type formatError string // is one of north, northeast, east, southeast, south, southwest, west, // northwest, center. // -// hexpand/vexpand(widget) forces the horizontalor or vertical +// hexp/vexp/exp(widget) forces the horizontal, vertical or both // constraints to their maximum before laying out widget. // // hcap/vcap(size, widget) caps the maximum horizontal or vertical @@ -131,6 +131,13 @@ func formatLayout(gtx *Context, state *formatState, widgets []Widget) { ctxLayout(gtx, cs, func() { formatExpr(gtx, state, widgets) }) + case "exp": + cs := gtx.Constraints + cs.Width.Min = cs.Width.Max + cs.Height.Min = cs.Height.Max + ctxLayout(gtx, cs, func() { + formatExpr(gtx, state, widgets) + }) case "hcap": w := parseValue(state) expect(state, ",")