use new Icon property for search field
This commit is contained in:
@@ -31,6 +31,7 @@ func NewSearchEntry() *SearchEntry {
|
||||
|
||||
// For use only by extending widgets
|
||||
func (sf *SearchEntry) Init() {
|
||||
sf.Icon = theme.SearchIcon()
|
||||
sf.PlaceHolder = lang.L("Search")
|
||||
sf.ActionItem = NewClearTextButton(func() {
|
||||
sf.SetText("")
|
||||
@@ -83,7 +84,7 @@ func (s *SearchEntry) updateActionButton() bool {
|
||||
btn := s.ActionItem.(*searchActionButton)
|
||||
oldResouce := btn.Resource
|
||||
if s.Text == "" {
|
||||
btn.Resource = theme.SearchIcon()
|
||||
btn.Resource = nil
|
||||
} else {
|
||||
btn.Resource = theme.ContentClearIcon()
|
||||
}
|
||||
@@ -111,7 +112,6 @@ func (s *SearchEntry) sendSearch(text string) {
|
||||
func NewClearTextButton(onTapped func()) *searchActionButton {
|
||||
c := &searchActionButton{OnTapped: onTapped}
|
||||
c.ExtendBaseWidget(c)
|
||||
c.Resource = theme.SearchIcon()
|
||||
c.icon = widget.NewIcon(c.Resource)
|
||||
return c
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user