mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-04 08:55:35 +00:00
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:
@@ -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)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user