Skip to content

Commit

Permalink
dont muck up music presentation views
Browse files Browse the repository at this point in the history
  • Loading branch information
sevenrats committed Jan 28, 2023
1 parent 2fa3a98 commit 9d1b4d3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
22 changes: 17 additions & 5 deletions components/ItemGrid/MusicArtistGridItem.brs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,24 @@ sub init()
end if

m.gridTitles = get_user_setting("itemgrid.gridTitles")
m.posterText.visible = m.gridTitles = "showalways"
m.postTextBackground.visible = m.posterText.visible
m.posterText.visible = false
m.postTextBackground.visible = false

end sub

sub itemContentChanged()
m.backdrop.blendColor = "#101010"

m.posterText.visible = false
m.postTextBackground.visible = false

if isValid(m.topParent.showItemTitles)
if LCase(m.topParent.showItemTitles) = "showalways"
m.posterText.visible = true
m.postTextBackground.visible = true
end if
end if

itemData = m.top.itemContent

if not isValid(itemData) then return
Expand All @@ -47,9 +57,11 @@ end sub

'Display or hide title Visibility on focus change
sub focusChanged()
if m.gridTitles = "showonhover"
m.posterText.visible = m.top.itemHasFocus
m.postTextBackground.visible = m.posterText.visible
if isValid(m.topParent.showItemTitles)
if LCase(m.topParent.showItemTitles) = "showonhover"
m.posterText.visible = m.top.itemHasFocus
m.postTextBackground.visible = m.posterText.visible
end if
end if
end sub

Expand Down
3 changes: 3 additions & 0 deletions components/ItemGrid/MusicLibraryView.brs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ sub loadInitialItems()
m.sortAscending = false
end if

m.top.showItemTitles = get_user_setting("itemgrid.gridTitles")

if LCase(m.top.parentItem.json.type) = "musicgenre"
m.itemGrid.translation = "[96, 60]"
m.loadItemsTask.itemType = "MusicAlbum"
Expand All @@ -143,6 +145,7 @@ sub loadInitialItems()
m.loadItemsTask.itemId = m.top.parentItem.parentFolder
else if LCase(m.view) = "artistspresentation" or LCase(m.options.view) = "artistspresentation"
m.loadItemsTask.genreIds = ""
m.top.showItemTitles = "hidealways"
else if LCase(m.view) = "artistsgrid" or LCase(m.options.view) = "artistsgrid"
m.loadItemsTask.genreIds = ""
else
Expand Down
2 changes: 1 addition & 1 deletion components/ItemGrid/MusicLibraryView.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
</children>
<interface>
<field id="HomeLibraryItem" type="string"/>
<field id="View" type="string"/>
<field id="parentItem" type="node" onChange="loadInitialItems" />
<field id="selectedItem" type="node" alwaysNotify="true" />
<field id="quickPlayNode" type="node" alwaysNotify="true" />
<field id="imageDisplayMode" type="string" value="scaleToZoom" />
<field id="AlphaSelected" type="string" alias="AlphaMenu.itemAlphaSelected" alwaysNotify="true" onChange="onItemAlphaSelected" />
<field id="alphaActive" type="boolean" value="false" />
<field id="showItemTitles" type="string" value="showonhover" />
<field id="jumpToItem" type="integer" value="" />
</interface>
<script type="text/brightscript" uri="pkg:/source/utils/misc.brs" />
Expand Down

0 comments on commit 9d1b4d3

Please sign in to comment.