Skip to content

Commit

Permalink
fix focus
Browse files Browse the repository at this point in the history
  • Loading branch information
sevenrats committed Feb 1, 2023
1 parent dd4073d commit 2fb8d7f
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions components/PersonDetails.brs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ sub init()
m.dscr = m.top.findNode("description")
m.vidsList = m.top.findNode("extrasGrid")
m.btnGrp = m.top.findNode("buttons")
m.btnGrp.observeField("escape", "onButtonGroupEscaped")
m.favBtn = m.top.findNode("favorite-button")
m.extrasGrp = m.top.findNode("extrasGrp")
m.top.findNode("VertSlider").keyValue = "[[30, 998], [30, 789], [30, 580], [30,371 ], [30, 162]]"
Expand Down Expand Up @@ -66,11 +67,20 @@ sub dscrShowFocus()
end if
end sub

sub onButtonGroupEscaped()
key = m.btnGrp.escape
if key = "down"
m.dscr.setFocus(true)
m.dscr.opacity = 1.0
m.top.findNode("dscrBorder").color = "#d0d0d0ff"
end if
end sub

function onKeyEvent(key as string, press as boolean) as boolean
if not press then return false

if key = "OK"
if m.dscr.hasFocus() and m.dscr.isTextEllipsized
if m.dscr.hasFocus()
createFullDscrDlg()
return true
end if
Expand All @@ -83,12 +93,7 @@ function onKeyEvent(key as string, press as boolean) as boolean
end if

if key = "down"
if m.favBtn.hasFocus()
m.dscr.setFocus(true)
m.dscr.opacity = 1.0
m.top.findNode("dscrBorder").color = "#d0d0d0ff"
return true
else if m.dscr.hasFocus()
if m.dscr.hasFocus()
m.dscr.opacity = 0.6
m.top.findNode("dscrBorder").color = "#data202020ff"
m.vidsList.setFocus(true)
Expand Down Expand Up @@ -130,19 +135,13 @@ end sub

sub createFullDscrDlg()
dlg = CreateObject("roSGNode", "OverviewDialog")
dlg.Title = tr("Press 'OK' to Close")
dlg.width = 1290
dlg.Title = m.top.itemContent.json.Name
dlg.width = 1400
dlg.palette = m.dlgPalette
dlg.overview = [m.dscr.text]
m.fullDscrDlg = dlg
m.top.getScene().dialog = dlg
border = createObject("roSGNode", "Poster")
border.uri = "pkg:/images/hd_focul_9.png"
border.blendColor = "#c9c9c9ff"
border.width = dlg.width + 6
border.height = dlg.height + 6
border.translation = [dlg.translation[0] - 3, dlg.translation[1] - 3]
border.visible = true

end sub

sub createDialogPallete()
Expand Down

0 comments on commit 2fb8d7f

Please sign in to comment.