Add 'X' button to password filter.
This commit is contained in:
parent
db1c958073
commit
54c2c00455
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue
Block a user