Use panelIndex to better track panel changes

This commit is contained in:
Nick Bisby 2019-04-05 20:14:56 -05:00
parent 1db5ebeefb
commit 8197a91821
No known key found for this signature in database
GPG Key ID: F6E0C4E6D0B5EB36
2 changed files with 16 additions and 12 deletions

View File

@ -13,7 +13,10 @@
<interface>
<field id="itemData" type="node" onChange="dataChanged" />
<field id="seasonData" type="associativearray" onChange="seasonChanged" />
<field id="focus" type="node" onChange="focusChanged" alias="panelset.focusedChild" alwaysNotify="false" />
<field id="panelFocused"
alias="panelset.leftPanelIndex"
type="integer"
onChange="panelFocusChanged" />
</interface>
<script type="text/brightscript">
<![CDATA[
@ -41,10 +44,19 @@
m.top.findNode("seasons").TVSeasonData = m.top.seasonData
end sub
sub focusChanged()
if m.top.focus.id = "panel-desc"
m.top.focus.findNode("buttons").setFocus(true)
sub panelFocusChanged()
set = m.top.findNode("panelset")
index = m.top.panelFocused
if index = 0
' Description page
' TODO - get the buttons to actually take focus back
set.findNode("description").findNode("buttons").setFocus(true)
else if index = 1
' Seasons page
set.findNode("seasons").setFocus(true)
end if
end sub
]]>
</script>

View File

@ -24,7 +24,6 @@
</children>
<interface>
<field id="itemContent" type="node" onChange="itemContentChanged" />
<field id="focused" type="boolean" onChange="focusChanged" />
</interface>
<script type="text/brightscript" uri="pkg:/components/tvshows/details.brs" />
<script type="text/brightscript">
@ -39,13 +38,6 @@
button.minWidth = 350
end for
end sub
sub focusChanged()
print "HI"
print m.top.focused
end sub
]]>
</script>
</component>