From f6443963edab3f0ba5eed62183bdccddf77e469a Mon Sep 17 00:00:00 2001 From: Zack Hovatter Date: Sun, 3 Jan 2021 16:04:42 -0500 Subject: [PATCH] Add secure text input to demo page --- _demo/page.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/_demo/page.go b/_demo/page.go index 4aa155d..7ee20cb 100644 --- a/_demo/page.go +++ b/_demo/page.go @@ -507,12 +507,34 @@ func textInputPage(res *uiResources) *page { ) c.AddChild(t) + tSecure := widget.NewTextInput( + widget.TextInputOpts.Placeholder("Enter password here"), + widget.TextInputOpts.WidgetOpts(widget.WidgetOpts.LayoutData(widget.RowLayoutData{ + Stretch: true, + })), + widget.TextInputOpts.Image(res.textInput.image), + widget.TextInputOpts.Color(res.textInput.color), + widget.TextInputOpts.Padding(widget.Insets{ + Left: 13, + Right: 13, + Top: 7, + Bottom: 7, + }), + widget.TextInputOpts.Face(res.textInput.face), + widget.TextInputOpts.CaretOpts( + widget.CaretOpts.Size(res.textInput.face, 2), + ), + widget.TextInputOpts.Secure(true), + ) + c.AddChild(tSecure) + c.AddChild(newSeparator(res, widget.RowLayoutData{ Stretch: true, })) c.AddChild(newCheckbox("Disabled", func(args *widget.CheckboxChangedEventArgs) { t.GetWidget().Disabled = args.State == widget.CheckboxChecked + tSecure.GetWidget().Disabled = args.State == widget.CheckboxChecked }, res)) return &page{