Skip to content

Commit

Permalink
Add secure text input to demo page
Browse files Browse the repository at this point in the history
  • Loading branch information
hovatterz committed Jan 3, 2021
1 parent 14c025f commit f644396
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions _demo/page.go
Expand Up @@ -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{
Expand Down

0 comments on commit f644396

Please sign in to comment.