Complete search section behavior
This commit is contained in:
@@ -269,6 +269,14 @@ func (u *ui) filteredTitles() []string {
|
||||
return titles
|
||||
}
|
||||
|
||||
func (u *ui) visiblePathContexts() []string {
|
||||
paths := make([]string, 0, len(u.visible))
|
||||
for _, item := range u.visible {
|
||||
paths = append(paths, u.state.SearchPathContext(item))
|
||||
}
|
||||
return paths
|
||||
}
|
||||
|
||||
func (u *ui) selectedEntry() (entry, bool) {
|
||||
for _, item := range u.visible {
|
||||
if item.ID == u.state.SelectedEntryID {
|
||||
@@ -862,7 +870,7 @@ func (u *ui) entryRow(gtx layout.Context, click *widget.Clickable, idx int, item
|
||||
if strings.TrimSpace(u.search.Text()) == "" {
|
||||
return layout.Dimensions{}
|
||||
}
|
||||
lbl := material.Label(u.theme, unit.Sp(11), strings.Join(item.Path, " / "))
|
||||
lbl := material.Label(u.theme, unit.Sp(11), u.state.SearchPathContext(item))
|
||||
lbl.Color = mutedColor
|
||||
return lbl.Layout(gtx)
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user