Revert "widget/material: propagate ButtonLayout minimum constraints to content"

This reverts commit 52ccc183b5.

Reason for revert:

This doesn't seem like a good idea after all. The reason for the change was to
propagate the minimum constraints to the button content. But in the simplest case,
a label, stretching the button will make the label stretch as well, leaving the label
top-aligned.

We'll revisit this issue if a real use-case comes up.
This commit is contained in:
Elias Naur
2020-04-16 19:57:19 +02:00
parent b8cbc1e99d
commit b1aed3eae0
2 changed files with 2 additions and 27 deletions
+2 -2
View File
@@ -109,9 +109,9 @@ func (b ButtonLayout) Layout(gtx *layout.Context, button *widget.Button, w layou
}
}),
layout.Stacked(func() {
gtx.Constraints.Width.Min = hmin
gtx.Constraints.Height.Min = vmin
layout.Center.Layout(gtx, func() {
gtx.Constraints.Width.Min = hmin
gtx.Constraints.Height.Min = vmin
b.Inset.Layout(gtx, func() {
paint.ColorOp{Color: b.Color}.Add(gtx.Ops)
w()