Received: from mail.senf.fr (mail.senf.fr [45.154.60.74]) by mail.sr.ht (Postfix) with ESMTPS id 2F7A140268 for <~eliasnaur/gio-patches@lists.sr.ht>; Fri, 3 Jan 2020 19:36:22 +0000 (UTC) Authentication-Results: mail.sr.ht; dkim=pass (1024-bit key) header.d=alt.tf header.i=@alt.tf header.b=Q795Mjhu Received: from sibeal.alt.tf (unknown [IPv6:2a01:e35:2ecb:5850:d634:bcc7:fec7:85]) (using TLSv1.2 with cipher DHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mail.senf.fr (Postfix) with ESMTPSA id 24F0C7F08E; Fri, 3 Jan 2020 20:36:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=alt.tf; s=default; t=1578080180; bh=O17J0GayzSaZot4hY7EZB3vviZiNAw/H7pV+xUfqNg4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q795Mjhu7AfsJrln1yrNAjImSqfWB+4eMXzqSdlm+Phl9ACPa8jaWr4VuDyVHsx2E c37bXC6u6tJAEhY0EC2I9PNal3gU7WR+bsUuGtxqF+Igx/JuOrlh3jybM4RwCy9lmQ 95ZjBMhNZWRN0nlP2nc4X0Eh5JIjEiJcAvyTH1VY= From: manur To: ~eliasnaur/gio-patches@lists.sr.ht Cc: manur Subject: [PATCH] Typo fix Date: Fri, 3 Jan 2020 20:36:17 +0100 Message-Id: <20200103193617.977989-1-dever@alt.tf> X-Mailer: git-send-email 2.24.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Signed-off-by: manur --- This will allow to use button material in larger widget and be able to se= t alignment of text In my case i've used the button to avoid rewriting the layout/click visua= l response for a file explorer (used in a list , the button will take all= available space but centering it doesn't look good) widget/material/button.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/widget/material/button.go b/widget/material/button.go index d630805..86ccd59 100644 --- a/widget/material/button.go +++ b/widget/material/button.go @@ -20,12 +20,12 @@ import ( type Button struct { Text string // Color is the text color. - Color color.RGBA - Font text.Font - Background color.RGBA - CornerRadius unit.Value - shaper *text.Shaper - TextAlignement layout.Direction + Color color.RGBA + Font text.Font + Background color.RGBA + CornerRadius unit.Value + shaper *text.Shaper + TextAlignment layout.Direction } =20 type IconButton struct { @@ -44,8 +44,8 @@ func (t *Theme) Button(txt string) Button { Font: text.Font{ Size: t.TextSize.Scale(14.0 / 16.0), }, - shaper: t.Shaper, - TextAlignement: layout.Center, + shaper: t.Shaper, + TextAlignment: layout.Center, } } =20 @@ -82,7 +82,7 @@ func (b Button) Layout(gtx *layout.Context, button *wid= get.Button) { layout.Stacked(func() { gtx.Constraints.Width.Min =3D hmin gtx.Constraints.Height.Min =3D vmin - layout.Align(b.TextAlignement).Layout(gtx, func() { + layout.Align(b.TextAlignment).Layout(gtx, func() { layout.Inset{Top: unit.Dp(10), Bottom: unit.Dp(10), Left: unit.Dp(12= ), Right: unit.Dp(12)}.Layout(gtx, func() { paint.ColorOp{Color: col}.Add(gtx.Ops) widget.Label{}.Layout(gtx, b.shaper, b.Font, b.Text) --=20 2.24.1