use new Icon property for search field

This commit is contained in:
Drew Weymouth
2025-11-15 10:35:17 -08:00
parent ada65b0943
commit 9f399a447c
+2 -2
View File
@@ -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
}