summaryrefslogtreecommitdiff
path: root/go
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2023-04-11 21:15:27 +0200
committerxengineering <me@xengineering.eu>2023-04-11 21:15:27 +0200
commit7430798f239642813d5695baefb6066c28ed2f56 (patch)
tree2a074c9a64a9879863bd1edf4c617f40aab286bb /go
parent58c8ae6edee39192589d9e754c053c4cf2b9d961 (diff)
downloadlimox-7430798f239642813d5695baefb6066c28ed2f56.tar
limox-7430798f239642813d5695baefb6066c28ed2f56.tar.zst
limox-7430798f239642813d5695baefb6066c28ed2f56.zip
Add editor widgets for JID and password
These are needed to provide credentials.
Diffstat (limited to 'go')
-rw-r--r--go/main.go24
1 files changed, 19 insertions, 5 deletions
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)
},
),