Add a backdrop as a placeholder for no image found

This commit is contained in:
Nick Bisby 2019-03-17 00:37:23 -05:00
parent bcb354c418
commit 95fd91fb70
No known key found for this signature in database
GPG Key ID: F6E0C4E6D0B5EB36
3 changed files with 16 additions and 9 deletions

View File

@ -1,6 +1,9 @@
<?xml version="1.0" encoding="utf-8" ?>
<component name="ListPoster" extends="Group">
<children>
<Rectangle id="backdrop"
translation="[2, 0]"
/>
<Poster id="poster"
translation="[2, 0]"
/>
@ -20,6 +23,9 @@
sub init()
m.title = m.top.findNode("title")
m.poster = m.top.findNode("poster")
m.backdrop = m.top.findNode("backdrop")
m.backdrop.color = "#404040FF"
updateSize()
end sub
@ -27,6 +33,7 @@
sub updateSize()
m.title = m.top.findNode("title")
m.poster = m.top.findNode("poster")
m.backdrop = m.top.findNode("backdrop")
' TODO - abstract this in case the parent doesnt have itemSize
maxSize = m.top.getParent().itemSize
@ -34,6 +41,9 @@
m.poster.width = int(maxSize[0]) - 4
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.height = int(maxSize[1]) - m.poster.height
m.title.translation = [0, m.poster.height]

View File

@ -2,7 +2,7 @@
<component name="SearchRow" extends="RowList">
<interface>
<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="itemSelected" type="int" />
</interface>
@ -18,11 +18,14 @@
m.top.rowLabelOffset = [0, 20]
m.top.showRowCounter = [ true ]
' TODO - Define a failed to load image background
' m.top.failedBitmapURI
m.top.setFocus(true)
end sub
sub updateSize()
m.top.numRows = 1
' In search results, rowSize only dictates how many are on screen at once
m.top.rowSize = 5
dimensions = m.top.getScene().currentDesignResolution
@ -41,10 +44,6 @@
m.top.rowItemSpacing = [0, 0]
end sub
sub setData()
m.top.content = getData()
end sub
function getData()
if m.top.itemData = invalid then
data = CreateObject("roSGNode", "ContentNode")
@ -80,6 +79,7 @@
end if
end for
m.top.content = data
return data
end function

View File

@ -342,9 +342,6 @@ sub ShowSearchOptions(query)
options = scene.findNode("SearchSelect")
page_num = 1
page_size = 30
sort_order = get_user_setting("search_sort_order", "Descending")
sort_field = get_user_setting("search_sort_field", "DateCreated,SortName")