Colorize background of items with no poster

This commit is contained in:
Neil Burrows 2020-05-31 14:47:03 +01:00
parent ea245d2abc
commit aad789c87c
3 changed files with 13 additions and 1 deletions

View File

@ -2,8 +2,13 @@ sub init()
m.title = m.top.findNode("title")
m.staticTitle = m.top.findNode("staticTitle")
m.poster = m.top.findNode("poster")
m.backdrop = m.top.findNode("backdrop")
m.backdrop.color = "#404040FF"
' Randmomise the background colors
posterBackgrounds = [ "#5ccea9", "#d2b019", "#dd452b", "#338abb", "#6b689d" ]
m.backdrop.color = posterBackgrounds[rnd(posterBackgrounds.count()) - 1]
updateSize()
end sub

View File

@ -16,6 +16,12 @@ sub itemContentChanged()
m.itemText.maxWidth = imageWidth
itemTextExtra.width = imageWidth
' Randmomise the background colors
m.backdrop = m.top.findNode("backdrop")
posterBackgrounds = [ "#5ccea9", "#d2b019", "#dd452b", "#338abb", "#6b689d" ]
m.backdrop.color = posterBackgrounds[rnd(posterBackgrounds.count()) - 1]
m.backdrop.width = imageWidth
' Whether to use WidePoster or Thumbnail in this row
usePoster = m.top.GetParent().content.usePoster

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<component name="HomeItem" extends="Group">
<children>
<Rectangle id="backdrop" width="464" height="261" translation="[8,5]" />
<Poster id="itemPoster" width="464" height="261" translation="[8,5]" />
<ScrollingLabel id="itemText" horizAlign="center" vertAlign="center" font="font:SmallBoldSystemFont" height="64" maxWidth="456" translation="[8,267]" repeatCount="0" />
<Label id="itemTextExtra" horizAlign="left" vertAlign="center" font="font:SmallBoldSystemFont" height="32" width="456" translation="[8,300]" visible="false" color="#777777FF" />