Skip to content

Commit 973e819

Browse files
committed
use new Icon property for search field
1 parent 62dd5bf commit 973e819

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ui/widgets/searchentry.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ func NewSearchEntry() *SearchEntry {
3131

3232
// For use only by extending widgets
3333
func (sf *SearchEntry) Init() {
34+
sf.Icon = theme.SearchIcon()
3435
sf.PlaceHolder = lang.L("Search")
3536
sf.ActionItem = NewClearTextButton(func() {
3637
sf.SetText("")
@@ -83,7 +84,7 @@ func (s *SearchEntry) updateActionButton() bool {
8384
btn := s.ActionItem.(*searchActionButton)
8485
oldResouce := btn.Resource
8586
if s.Text == "" {
86-
btn.Resource = theme.SearchIcon()
87+
btn.Resource = nil
8788
} else {
8889
btn.Resource = theme.ContentClearIcon()
8990
}
@@ -111,7 +112,6 @@ func (s *SearchEntry) sendSearch(text string) {
111112
func NewClearTextButton(onTapped func()) *searchActionButton {
112113
c := &searchActionButton{OnTapped: onTapped}
113114
c.ExtendBaseWidget(c)
114-
c.Resource = theme.SearchIcon()
115115
c.icon = widget.NewIcon(c.Resource)
116116
return c
117117
}

0 commit comments

Comments
 (0)