Add a backdrop as a placeholder for no image found
This commit is contained in:
parent
bcb354c418
commit
95fd91fb70
|
@ -1,6 +1,9 @@
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<component name="ListPoster" extends="Group">
|
<component name="ListPoster" extends="Group">
|
||||||
<children>
|
<children>
|
||||||
|
<Rectangle id="backdrop"
|
||||||
|
translation="[2, 0]"
|
||||||
|
/>
|
||||||
<Poster id="poster"
|
<Poster id="poster"
|
||||||
translation="[2, 0]"
|
translation="[2, 0]"
|
||||||
/>
|
/>
|
||||||
|
@ -20,6 +23,9 @@
|
||||||
sub init()
|
sub init()
|
||||||
m.title = m.top.findNode("title")
|
m.title = m.top.findNode("title")
|
||||||
m.poster = m.top.findNode("poster")
|
m.poster = m.top.findNode("poster")
|
||||||
|
m.backdrop = m.top.findNode("backdrop")
|
||||||
|
|
||||||
|
m.backdrop.color = "#404040FF"
|
||||||
|
|
||||||
updateSize()
|
updateSize()
|
||||||
end sub
|
end sub
|
||||||
|
@ -27,6 +33,7 @@
|
||||||
sub updateSize()
|
sub updateSize()
|
||||||
m.title = m.top.findNode("title")
|
m.title = m.top.findNode("title")
|
||||||
m.poster = m.top.findNode("poster")
|
m.poster = m.top.findNode("poster")
|
||||||
|
m.backdrop = m.top.findNode("backdrop")
|
||||||
|
|
||||||
' TODO - abstract this in case the parent doesnt have itemSize
|
' TODO - abstract this in case the parent doesnt have itemSize
|
||||||
maxSize = m.top.getParent().itemSize
|
maxSize = m.top.getParent().itemSize
|
||||||
|
@ -34,6 +41,9 @@
|
||||||
m.poster.width = int(maxSize[0]) - 4
|
m.poster.width = int(maxSize[0]) - 4
|
||||||
m.poster.height = m.poster.width * 1.5
|
m.poster.height = m.poster.width * 1.5
|
||||||
|
|
||||||
|
m.backdrop.width = m.poster.width
|
||||||
|
m.backdrop.height = m.poster.height
|
||||||
|
|
||||||
m.title.width = m.poster.width
|
m.title.width = m.poster.width
|
||||||
m.title.height = int(maxSize[1]) - m.poster.height
|
m.title.height = int(maxSize[1]) - m.poster.height
|
||||||
m.title.translation = [0, m.poster.height]
|
m.title.translation = [0, m.poster.height]
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<component name="SearchRow" extends="RowList">
|
<component name="SearchRow" extends="RowList">
|
||||||
<interface>
|
<interface>
|
||||||
<field id="rowSize" type="int" />
|
<field id="rowSize" type="int" />
|
||||||
<field id="itemData" type="associativeArray" onChange="setData" />
|
<field id="itemData" type="associativeArray" onChange="getData" />
|
||||||
<field id="query" type="string" />
|
<field id="query" type="string" />
|
||||||
<field id="itemSelected" type="int" />
|
<field id="itemSelected" type="int" />
|
||||||
</interface>
|
</interface>
|
||||||
|
@ -18,11 +18,14 @@
|
||||||
m.top.rowLabelOffset = [0, 20]
|
m.top.rowLabelOffset = [0, 20]
|
||||||
m.top.showRowCounter = [ true ]
|
m.top.showRowCounter = [ true ]
|
||||||
|
|
||||||
|
' TODO - Define a failed to load image background
|
||||||
|
' m.top.failedBitmapURI
|
||||||
|
|
||||||
m.top.setFocus(true)
|
m.top.setFocus(true)
|
||||||
end sub
|
end sub
|
||||||
|
|
||||||
sub updateSize()
|
sub updateSize()
|
||||||
m.top.numRows = 1
|
' In search results, rowSize only dictates how many are on screen at once
|
||||||
m.top.rowSize = 5
|
m.top.rowSize = 5
|
||||||
|
|
||||||
dimensions = m.top.getScene().currentDesignResolution
|
dimensions = m.top.getScene().currentDesignResolution
|
||||||
|
@ -41,10 +44,6 @@
|
||||||
m.top.rowItemSpacing = [0, 0]
|
m.top.rowItemSpacing = [0, 0]
|
||||||
end sub
|
end sub
|
||||||
|
|
||||||
sub setData()
|
|
||||||
m.top.content = getData()
|
|
||||||
end sub
|
|
||||||
|
|
||||||
function getData()
|
function getData()
|
||||||
if m.top.itemData = invalid then
|
if m.top.itemData = invalid then
|
||||||
data = CreateObject("roSGNode", "ContentNode")
|
data = CreateObject("roSGNode", "ContentNode")
|
||||||
|
@ -80,6 +79,7 @@
|
||||||
end if
|
end if
|
||||||
end for
|
end for
|
||||||
|
|
||||||
|
m.top.content = data
|
||||||
return data
|
return data
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
|
|
@ -342,9 +342,6 @@ sub ShowSearchOptions(query)
|
||||||
|
|
||||||
options = scene.findNode("SearchSelect")
|
options = scene.findNode("SearchSelect")
|
||||||
|
|
||||||
page_num = 1
|
|
||||||
page_size = 30
|
|
||||||
|
|
||||||
sort_order = get_user_setting("search_sort_order", "Descending")
|
sort_order = get_user_setting("search_sort_order", "Descending")
|
||||||
sort_field = get_user_setting("search_sort_field", "DateCreated,SortName")
|
sort_field = get_user_setting("search_sort_field", "DateCreated,SortName")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user