From 7430798f239642813d5695baefb6066c28ed2f56 Mon Sep 17 00:00:00 2001 From: xengineering Date: Tue, 11 Apr 2023 21:15:27 +0200 Subject: Add editor widgets for JID and password These are needed to provide credentials. --- go/main.go | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'go') diff --git a/go/main.go b/go/main.go index 859b8e6..108ebc9 100644 --- a/go/main.go +++ b/go/main.go @@ -17,10 +17,12 @@ import ( ) type Limox struct { - Button widget.Clickable - Window *app.Window - Operations op.Ops - Theme *material.Theme + JidEditor widget.Editor + PwdEditor widget.Editor + ConnectClickable widget.Clickable + Window *app.Window + Operations op.Ops + Theme *material.Theme } func main() { @@ -79,7 +81,19 @@ func (l *Limox) draw(e system.FrameEvent) { ), layout.Rigid( func(gtx layout.Context) layout.Dimensions { - btn := material.Button(l.Theme, &l.Button, "connect") + jid := material.Editor(l.Theme, &l.JidEditor, "user@example.com") + return jid.Layout(gtx) + }, + ), + layout.Rigid( + func(gtx layout.Context) layout.Dimensions { + pwd := material.Editor(l.Theme, &l.PwdEditor, "mySafePassword") + return pwd.Layout(gtx) + }, + ), + layout.Rigid( + func(gtx layout.Context) layout.Dimensions { + btn := material.Button(l.Theme, &l.ConnectClickable, "connect") return btn.Layout(gtx) }, ), -- cgit v1.2.3-70-g09d2