From c78947f6f2f20e49317caeca42462b001ea5b610 Mon Sep 17 00:00:00 2001 From: Chris Waldon Date: Tue, 18 Apr 2023 08:01:59 -0400 Subject: [PATCH] go.*,component: update component TextField usage This commit updates the component demo's TextField page to use the correct alignment option after gioui.org/x@b853331 Signed-off-by: Chris Waldon --- component/pages/textfield/textfield.go | 11 ++++++----- go.mod | 5 ++--- go.sum | 7 ++----- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/component/pages/textfield/textfield.go b/component/pages/textfield/textfield.go index ba63503..d93a9b0 100644 --- a/component/pages/textfield/textfield.go +++ b/component/pages/textfield/textfield.go @@ -6,6 +6,7 @@ import ( "gioui.org/layout" "gioui.org/op" + "gioui.org/text" "gioui.org/widget" "gioui.org/widget/material" "gioui.org/x/component" @@ -23,7 +24,7 @@ type ( // Page holds the state for a page demonstrating the features of // the TextField component. type Page struct { - inputAlignment layout.Alignment + inputAlignment text.Alignment inputAlignmentEnum widget.Enum nameInput, addressInput, priceInput, tweetInput, numberInput component.TextField widget.List @@ -131,13 +132,13 @@ func (p *Page) Layout(gtx C, th *material.Theme) D { if p.inputAlignmentEnum.Changed() { switch p.inputAlignmentEnum.Value { case layout.Start.String(): - p.inputAlignment = layout.Start + p.inputAlignment = text.Start case layout.Middle.String(): - p.inputAlignment = layout.Middle + p.inputAlignment = text.Middle case layout.End.String(): - p.inputAlignment = layout.End + p.inputAlignment = text.End default: - p.inputAlignment = layout.Start + p.inputAlignment = text.Start } op.InvalidateOp{}.Add(gtx.Ops) } diff --git a/go.mod b/go.mod index 58f287a..1183623 100644 --- a/go.mod +++ b/go.mod @@ -6,11 +6,9 @@ require ( eliasnaur.com/font v0.0.0-20230308162249-dd43949cb42d gioui.org v0.0.0-20230401135047-e768fe347a73 gioui.org/cmd v0.0.0-20220818080936-02068d6340fc - gioui.org/x v0.0.0-20230403130642-fd712aa4daf5 - github.com/benoitkugler/textlayout v0.3.0 + gioui.org/x v0.0.0-20230418115547-b8533313f976 github.com/go-gl/gl v0.0.0-20210315015930-ae072cafe09d github.com/go-gl/glfw/v3.3/glfw v0.0.0-20210311203641-62640a716d48 - github.com/go-text/typesetting v0.0.0-20230329143336-a38d00edd832 github.com/google/go-github/v24 v24.0.1 github.com/inkeliz/giohyperlink v0.0.0-20220903215451-2ac5d54abdce golang.org/x/exp v0.0.0-20221012211006-4de253d81b95 @@ -28,6 +26,7 @@ require ( github.com/akavel/rsrc v0.10.1 // indirect github.com/esiqveland/notify v0.11.0 // indirect github.com/go-ole/go-ole v1.2.6 // indirect + github.com/go-text/typesetting v0.0.0-20230329143336-a38d00edd832 // indirect github.com/godbus/dbus/v5 v5.0.6 // indirect github.com/golang/protobuf v1.4.2 // indirect github.com/google/go-querystring v1.0.0 // indirect diff --git a/go.sum b/go.sum index 33a4a16..af55b27 100644 --- a/go.sum +++ b/go.sum @@ -9,8 +9,8 @@ gioui.org/cpu v0.0.0-20210817075930-8d6a761490d2 h1:AGDDxsJE1RpcXTAxPG2B4jrwVUJG gioui.org/cpu v0.0.0-20210817075930-8d6a761490d2/go.mod h1:A8M0Cn5o+vY5LTMlnRoK3O5kG+rH0kWfJjeKd9QpBmQ= gioui.org/shader v1.0.6 h1:cvZmU+eODFR2545X+/8XucgZdTtEjR3QWW6W65b0q5Y= gioui.org/shader v1.0.6/go.mod h1:mWdiME581d/kV7/iEhLmUgUK5iZ09XR5XpduXzbePVM= -gioui.org/x v0.0.0-20230403130642-fd712aa4daf5 h1:Ks31mE4kQd8nWfMVv+KxAL0tO/veB2822tdqnNnDNBs= -gioui.org/x v0.0.0-20230403130642-fd712aa4daf5/go.mod h1:kUKv6aaVpK6WPXh47hFXHo2EIAZUoVIG5/a+7N8yNT4= +gioui.org/x v0.0.0-20230418115547-b8533313f976 h1:24NbXu/21ngR3euvzuZnXkn/G+mqZMxIkSaneyhuK54= +gioui.org/x v0.0.0-20230418115547-b8533313f976/go.mod h1:kUKv6aaVpK6WPXh47hFXHo2EIAZUoVIG5/a+7N8yNT4= git.sr.ht/~jackmordaunt/go-toast v1.0.0 h1:bbRox6VkotdOj3QcWimZQ84APoszIsA/pSIj8ypDdV8= git.sr.ht/~jackmordaunt/go-toast v1.0.0/go.mod h1:aIuRX/HdBOz7yRS8rOVYQCwJQlFS7DbYBTpUV0SHeeg= git.wow.st/gmp/jni v0.0.0-20210610011705-34026c7e22d0 h1:bGG/g4ypjrCJoSvFrP5hafr9PPB5aw8SjcOWWila7ZI= @@ -18,9 +18,6 @@ git.wow.st/gmp/jni v0.0.0-20210610011705-34026c7e22d0/go.mod h1:+axXBRUTIDlCeE73 github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/akavel/rsrc v0.10.1 h1:hCCPImjmFKVNGpeLZyTDRHEFC283DzyTXTo0cO0Rq9o= github.com/akavel/rsrc v0.10.1/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c= -github.com/benoitkugler/textlayout v0.3.0 h1:2ehWXEkgb6RUokTjXh1LzdGwG4dRP6X3dqhYYDYhUVk= -github.com/benoitkugler/textlayout v0.3.0/go.mod h1:o+1hFV+JSHBC9qNLIuwVoLedERU7sBPgEFcuSgfvi/w= -github.com/benoitkugler/textlayout-testdata v0.1.1 h1:AvFxBxpfrQd8v55qH59mZOJOQjtD6K2SFe9/HvnIbJk= github.com/chromedp/cdproto v0.0.0-20191114225735-6626966fbae4 h1:QD3KxSJ59L2lxG6MXBjNHxiQO2RmxTQ3XcK+wO44WOg= github.com/chromedp/chromedp v0.5.2 h1:W8xBXQuUnd2dZK0SN/lyVwsQM7KgW+kY5HGnntms194= github.com/esiqveland/notify v0.11.0 h1:0WJ/xW+3Ln8uRBYntG7f0XihXxnlOaQTdha1yyzXz30= -- 2.45.2