Add filter information to title when browsing a collection

This commit is contained in:
JD Layman 2021-09-13 21:43:11 -05:00
parent be24a19c8f
commit 692cb8e922
2 changed files with 13 additions and 1 deletions

View File

@ -72,6 +72,8 @@ sub loadInitialItems()
m.sortAscending = false
end if
updateTitle()
m.loadItemsTask.itemId = m.top.parentItem.Id
m.loadItemsTask.sortField = m.sortField
m.loadItemsTask.sortAscending = m.sortAscending
@ -372,6 +374,7 @@ sub optionsClosed()
end if
if m.options.filter <> m.filter
m.filter = m.options.filter
updateTitle()
reload = true
'Store filter setting
@ -445,3 +448,13 @@ function onKeyEvent(key as string, press as boolean) as boolean
end if
return false
end function
sub updateTitle()
if m.filter = "All"
m.top.overhangTitle = m.top.parentItem.title
else if m.filter = "Favorites"
m.top.overhangTitle = m.top.parentItem.title + " (Favorites)"
else
m.top.overhangTitle = m.top.parentItem.title + " (Filtered)"
end if
end sub

View File

@ -276,7 +276,6 @@ end function
function CreateItemGrid(libraryItem)
group = CreateObject("roSGNode", "ItemGrid")
group.parentItem = libraryItem
group.overhangTitle = libraryItem.title
group.optionsAvailable = true
group.observeField("selectedItem", m.port)
return group