From 27d81b8c7ef96084179721035b831be3d71203d1 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Fri, 27 Mar 2020 16:40:13 +0100 Subject: [PATCH] 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 --- widget/material/button.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/widget/material/button.go b/widget/material/button.go index 28c4bc43..194518a8 100644 --- a/widget/material/button.go +++ b/widget/material/button.go @@ -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) }) }