From b41e08f2323718d4aa0b691c14bf92b79bb2b748 Mon Sep 17 00:00:00 2001 From: Charles Ewert Date: Wed, 6 Dec 2023 09:37:20 -0500 Subject: [PATCH] remove left seperator from overhang --- components/JFOverhang.bs | 84 +++++---------------------- components/JFOverhang.xml | 9 +-- components/config/LoginScene.bs | 12 ++++ components/config/LoginScene.xml | 2 +- components/config/SetServerScreen.bs | 12 ++++ components/config/SetServerScreen.xml | 2 +- components/data/SceneManager.bs | 10 +--- components/home/Home.bs | 14 +++-- components/login/UserSelect.bs | 11 ++++ components/login/UserSelect.xml | 2 +- source/Main.bs | 1 - source/utils/misc.bs | 1 + 12 files changed, 64 insertions(+), 96 deletions(-) diff --git a/components/JFOverhang.bs b/components/JFOverhang.bs index 06c89a29..75f0f9f1 100644 --- a/components/JFOverhang.bs +++ b/components/JFOverhang.bs @@ -6,9 +6,6 @@ sub init() m.leftGroup = m.top.findNode("overlayLeftGroup") m.rightGroup = m.top.findNode("overlayRightGroup") - ' hide seperators till they're needed - m.leftSeperator = m.top.findNode("overlayLeftSeperator") - m.leftSeperator.visible = "false" m.rightSeperator = m.top.findNode("overlayRightSeperator") ' set font sizes m.optionText = m.top.findNode("overlayOptionsText") @@ -54,16 +51,7 @@ sub onVisibleChange() end sub sub updateTitle() - if m.top.title <> "" - m.leftSeperator.visible = "true" - else - m.leftSeperator.visible = "false" - end if m.title.text = m.top.title - - if not m.hideClock - resetTime() - end if end sub sub setClockVisibility() @@ -152,66 +140,22 @@ sub updateOptions() end if end sub -' Ensure the Jellyfin logo is shown on the overhang. -sub showLogo() +' component boolean field isLogoVisibleChange has changed value +sub isLogoVisibleChange() + isLogoVisible = m.top.isLogoVisible + scene = m.top.getScene() logo = scene.findNode("overlayLogo") - leftSeperator = scene.findNode("overlayLeftSeperator") - if not isValid(leftSeperator) - seperator = createSeperator("overlayLeftSeperator") - m.leftGroup.insertChild(seperator, 0) - end if - if not isValid(logo) - posterLogo = createLogoPoster() - m.leftGroup.insertChild(posterLogo, 0) - end if -end sub - -' Remove the Jellyfin logo from the overhang. -sub hideLogo() - scene = m.top.getScene() - - logo = scene.findNode("overlayLogo") - leftSeperator = scene.findNode("overlayLeftSeperator") - - if isValid(logo) - m.leftGroup.removeChild(logo) - end if - if isValid(leftSeperator) - m.leftGroup.removeChild(leftSeperator) - end if -end sub - -' Ensure the current user is shown on the overhang. -sub showUser() - print "HELLO from showUser()" - scene = m.top.getScene() - currentUser = scene.findNode("overlayCurrentUser") - rightSeperator = scene.findNode("overlayRightSeperator") - - if not isValid(rightSeperator) - seperator = createSeperator("overlayRightSeperator") - m.rightGroup.insertChild(seperator, 0) - end if - if not isValid(currentUser) - myUser = createOverhangUser() - myUser.text = m.top.currentUser - m.rightGroup.insertChild(myUser, 0) - end if -end sub - -' Remove the Jellyfin logo from the overhang. -sub hideUser() - scene = m.top.getScene() - - currentUser = scene.findNode("overlayCurrentUser") - rightSeperator = scene.findNode("overlayRightSeperator") - - if isValid(currentUser) - m.rightGroup.removeChild(currentUser) - end if - if isValid(rightSeperator) - m.rightGroup.removeChild(rightSeperator) + if isLogoVisible + if not isValid(logo) + posterLogo = createLogoPoster() + m.leftGroup.insertChild(posterLogo, 0) + end if + else + ' remove the logo + if isValid(logo) + m.leftGroup.removeChild(logo) + end if end if end sub diff --git a/components/JFOverhang.xml b/components/JFOverhang.xml index 8c789762..679e669a 100644 --- a/components/JFOverhang.xml +++ b/components/JFOverhang.xml @@ -1,9 +1,8 @@ - + @@ -38,10 +37,6 @@ - - - - - + \ No newline at end of file diff --git a/components/config/LoginScene.bs b/components/config/LoginScene.bs index 80b6c75a..f545b615 100644 --- a/components/config/LoginScene.bs +++ b/components/config/LoginScene.bs @@ -1,8 +1,20 @@ +import "pkg:/source/utils/misc.bs" + sub init() m.top.setFocus(true) m.top.optionsAvailable = false end sub +' JFScreen hook. +sub OnScreenShown() + scene = m.top.getScene() + overhang = scene.findNode("overhang") + if isValid(overhang) + overhang.isLogoVisible = true + overhang.currentUser = "" + end if +end sub + function onKeyEvent(key as string, press as boolean) as boolean ' Returns true if user navigates to a new focusable element if not press then return false diff --git a/components/config/LoginScene.xml b/components/config/LoginScene.xml index 9c32da74..ef6d6b91 100644 --- a/components/config/LoginScene.xml +++ b/components/config/LoginScene.xml @@ -1,5 +1,5 @@ - +