From e2976b8ed251a87ff6021d800a4a698f0b866bf9 Mon Sep 17 00:00:00 2001 From: 1hitsong <3330318+1hitsong@users.noreply.github.com> Date: Sat, 3 Sep 2022 16:06:57 -0400 Subject: [PATCH] Use slider controller --- components/IconButton.brs | 12 ++- components/IconButton.xml | 8 +- components/music/AlbumGrid.brs | 13 +++- components/music/AlbumGrid.xml | 2 +- components/music/ArtistView.brs | 102 ++++++++++++------------- components/music/ArtistView.xml | 56 ++++++-------- components/section/section.brs | 61 +++++++++++++++ components/section/section.xml | 30 ++++++++ components/section/sectionScroller.brs | 37 +++++++++ components/section/sectionScroller.xml | 12 +++ package-lock.json | 14 ++-- package.json | 2 +- 12 files changed, 250 insertions(+), 99 deletions(-) create mode 100644 components/section/section.brs create mode 100644 components/section/section.xml create mode 100644 components/section/sectionScroller.brs create mode 100644 components/section/sectionScroller.xml diff --git a/components/IconButton.brs b/components/IconButton.brs index ed328cf1..20176757 100644 --- a/components/IconButton.brs +++ b/components/IconButton.brs @@ -9,11 +9,11 @@ sub init() m.top.observeField("height", "onHeightChanged") m.top.observeField("width", "onWidthChanged") m.top.observeField("padding", "onPaddingChanged") - m.top.observeField("focusedChild", "onFocusChanged") + m.top.observeField("focus", "onFocusChanged") end sub sub onFocusChanged() - if m.top.hasFocus() + if m.top.focus m.buttonBackground.blendColor = m.top.focusBackground else m.buttonBackground.blendColor = m.top.background @@ -75,5 +75,13 @@ function onKeyEvent(key as string, press as boolean) as boolean return true end if + if key = "right" and m.top.hasFocus() + m.top.escape = "right" + end if + + if key = "left" and m.top.hasFocus() + m.top.escape = "left" + end if + return false end function diff --git a/components/IconButton.xml b/components/IconButton.xml index d8d0f51c..7201acdd 100644 --- a/components/IconButton.xml +++ b/components/IconButton.xml @@ -1,9 +1,9 @@ - - - @@ -14,6 +14,8 @@ + +