27d81b8c7ef96084179721035b831be3d71203d1 — Elias Naur 2 months ago 52ccc18
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>
1 files changed, 1 insertions(+), 1 deletions(-)

M widget/material/button.go
M widget/material/button.go => widget/material/button.go +1 -1
@@ 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)