Add 'X' button to password filter.

This commit is contained in:
Greg 2020-09-17 20:18:20 -04:00
parent db1c958073
commit 54c2c00455
1 changed files with 19 additions and 1 deletions

View File

@ -376,6 +376,13 @@ func eventLoop() {
Color: black,
Background: gray,
}
xBtn := &Button{
Size: unit.Sp(fontSize),
Label: "X",
Alignment: text.Middle,
Color: black,
Background: gray,
}
insertLabel := material.Label(th, unit.Sp(fontSize), "Insert")
passnameLabel := material.Label(th, unit.Sp(fontSize), "password name:")
@ -410,6 +417,7 @@ func eventLoop() {
return <-passch
}
lpf1 := &layout.Flex{Axis: layout.Horizontal}
listPage = func(gtx C) D {
// timing variables used for animation
fade1a, fade1b := 1.5, 2.0
@ -417,8 +425,18 @@ func eventLoop() {
fade2a, end := start2+1.5, start2+2.0
c2 := layout.Rigid(func(gtx C) D {
c21 := layout.Flexed(1, func(gtx C) D {
return material.Editor(th, FilterEd, "filter").Layout(gtx)
})
c22 := layout.Rigid(func(gtx C) D {
return xBtn.Layout(gtx)
})
if xBtn.Clicked() {
FilterEd.SetText("")
updateBtns()
}
return lpf1.Layout(gtx, c21, c22)
})
c3 := layout.Flexed(1.0, func(gtx C) D {
var ret D
mux.Lock()