remove Query from mediaprovider.SearchResult

This commit is contained in:
Drew Weymouth
2024-05-23 15:56:56 -07:00
parent d43b4a4c8f
commit 21feca3265
5 changed files with 16 additions and 13 deletions
+8 -3
View File
@@ -25,7 +25,7 @@ type SearchDialog struct {
widget.BaseWidget
OnDismiss func()
OnNavigateTo func(mediaprovider.ContentType, string, string)
OnNavigateTo func(mediaprovider.ContentType, string)
OnSearched func(string) []*mediaprovider.SearchResult
OnInit func() ([]*mediaprovider.SearchResult, *widget.Check)
@@ -82,10 +82,16 @@ func NewSearchDialog(im util.ImageFetcher, placeholderTitle string, onSearched f
return sd
}
// GetSearchEntry returns the search Entry widget for focusing
func (sd *SearchDialog) GetSearchEntry() fyne.Focusable {
return sd.searchEntry
}
// SearchQuery returns the current search query entered by the user
func (sd *SearchDialog) SearchQuery() string {
return sd.searchEntry.Text
}
func (sd *SearchDialog) Show() {
sd.onInit()
sd.BaseWidget.Show()
@@ -108,9 +114,8 @@ func (sd *SearchDialog) onSelected(idx int) {
}
id := sd.searchResults[idx].ID
typ := sd.searchResults[idx].Type
query := sd.searchResults[idx].Query
sd.resultsMutex.RUnlock()
sd.OnNavigateTo(typ, id, query)
sd.OnNavigateTo(typ, id)
}
func (sd *SearchDialog) moveSelectionDown() {