From f3b88f5c12e80904005d7c973b761470b940def1 Mon Sep 17 00:00:00 2001 From: Charles Ewert Date: Mon, 8 May 2023 23:57:47 -0400 Subject: [PATCH 001/105] fix button focus when local trailers not found --- components/movies/MovieDetails.brs | 18 ++++++++++++------ components/movies/MovieDetails.xml | 1 - 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/components/movies/MovieDetails.brs b/components/movies/MovieDetails.brs index 52c9572fa..46ab32d2c 100644 --- a/components/movies/MovieDetails.brs +++ b/components/movies/MovieDetails.brs @@ -9,8 +9,6 @@ sub init() m.options = m.top.findNode("movieOptions") m.infoGroup = m.top.findNode("infoGroup") - m.main_group = m.top.findNode("main_group") - main = m.top.findNode("main_group") main.translation = [96, 175] overview = m.top.findNode("overview") @@ -25,9 +23,6 @@ sub init() m.spinner = m.top.findNode("spinner") - m.trailerButton = m.top.findNode("trailer-button") - m.trailerButton.text = tr("Play Trailer") - m.top.observeField("itemContent", "itemContentChanged") end sub @@ -41,7 +36,18 @@ sub OnScreenShown() end sub sub trailerAvailableChanged() - m.trailerButton.visible = m.top.trailerAvailable + if m.top.trailerAvailable + ' add trailor button to button group + trailerButton = CreateObject("roSGNode", "JFButton") + trailerButton.id = "trailer-button" + trailerButton.text = tr("Play Trailer") + trailerButton.maxWidth = "300" + trailerButton.minWidth = "300" + m.buttonGrp.appendChild(trailerButton) + else + ' remove trailor button from button group + m.buttonGrp.removeChild(m.top.findNode("trailer-button")) + end if end sub sub itemContentChanged() diff --git a/components/movies/MovieDetails.xml b/components/movies/MovieDetails.xml index 86457cef6..cb850da0f 100644 --- a/components/movies/MovieDetails.xml +++ b/components/movies/MovieDetails.xml @@ -34,7 +34,6 @@