From fc8e80d9996f393ccfbbfde76b36bbabd6e27836 Mon Sep 17 00:00:00 2001 From: 1hitsong <3330318+1hitsong@users.noreply.github.com> Date: Thu, 7 Dec 2023 08:12:42 -0500 Subject: [PATCH 1/2] Fix focus on library row --- components/home/HomeRows.bs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/home/HomeRows.bs b/components/home/HomeRows.bs index b888da392..3bb3682b4 100644 --- a/components/home/HomeRows.bs +++ b/components/home/HomeRows.bs @@ -280,6 +280,12 @@ sub createLibraryRow() ' Row already exists, replace it with new content if sectionExists(sectionName) m.top.content.replaceChild(row, getSectionIndex(sectionName)) + + ' Reset focus to item within the row, if it was previous highlighted + if m.top.rowItemFocused[0] = getSectionIndex(sectionName) + m.top.jumpToRowItem = [m.top.rowItemFocused[0], m.top.rowItemFocused[1]] + end if + setRowItemSize() return end if From d0041745aca9891609bd2d4d0e300d2d31935f2f Mon Sep 17 00:00:00 2001 From: 1hitsong <3330318+1hitsong@users.noreply.github.com> Date: Thu, 7 Dec 2023 12:01:17 -0500 Subject: [PATCH 2/2] Don't recreate library row if it already exists --- components/home/HomeRows.bs | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/components/home/HomeRows.bs b/components/home/HomeRows.bs index 3bb3682b4..958ba22c3 100644 --- a/components/home/HomeRows.bs +++ b/components/home/HomeRows.bs @@ -267,6 +267,11 @@ sub createLibraryRow() sectionName = tr("My Media") + ' We don't refresh library data, so if section already exists, exit + if sectionExists(sectionName) + return + end if + row = CreateObject("roSGNode", "HomeRow") row.title = sectionName row.imageWidth = homeRowItemSizes.WIDE_POSTER[0] @@ -277,19 +282,6 @@ sub createLibraryRow() row.appendChild(item) end for - ' Row already exists, replace it with new content - if sectionExists(sectionName) - m.top.content.replaceChild(row, getSectionIndex(sectionName)) - - ' Reset focus to item within the row, if it was previous highlighted - if m.top.rowItemFocused[0] = getSectionIndex(sectionName) - m.top.jumpToRowItem = [m.top.rowItemFocused[0], m.top.rowItemFocused[1]] - end if - - setRowItemSize() - return - end if - ' Row does not exist, insert it into the home view m.top.content.insertChild(row, getOriginalSectionIndex("smalllibrarytiles")) setRowItemSize()