widget/material: re-center Button label

A previous change propagated the minimum layout constraints to Button's
content, which made Button no longer center its label when stretched.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-03-27 16:40:13 +01:00
parent 52ccc183b5
commit 27d81b8c7e
+1 -1
View File
@@ -86,7 +86,7 @@ func (b Button) Layout(gtx *layout.Context, button *widget.Button) {
Color: b.Color,
Inset: b.Inset,
}.Layout(gtx, button, func() {
widget.Label{}.Layout(gtx, b.shaper, b.Font, b.TextSize, b.Text)
widget.Label{Alignment: text.Middle}.Layout(gtx, b.shaper, b.Font, b.TextSize, b.Text)
})
}