From 357c3f1c0dcc3011c523b75eea4835a32a535104 Mon Sep 17 00:00:00 2001 From: 1hitsong <3330318+1hitsong@users.noreply.github.com> Date: Fri, 29 Dec 2023 19:27:40 -0500 Subject: [PATCH 1/2] Move selected subtitle to top of selection menu --- components/manager/ViewCreator.bs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/components/manager/ViewCreator.bs b/components/manager/ViewCreator.bs index eaf66f9ca..646681b0d 100644 --- a/components/manager/ViewCreator.bs +++ b/components/manager/ViewCreator.bs @@ -65,7 +65,7 @@ end sub ' User requested subtitle selection popup sub onSelectSubtitlePressed() - ' None is always first in the subtitle list + ' Manually create the None option subtitleData = { data: [{ "Index": -1, @@ -100,7 +100,12 @@ sub onSelectSubtitlePressed() end if end if - subtitleData.data.push(item) + ' Put the selected item at the top of the option list + if isValid(item.selected) and item.selected + subtitleData.data.Unshift(item) + else + subtitleData.data.push(item) + end if end for m.global.sceneManager.callFunc("radioDialog", tr("Select Subtitles"), subtitleData) From cb9c44867c93bd130d9c487fc821d83af7d4f1e9 Mon Sep 17 00:00:00 2001 From: 1hitsong <3330318+1hitsong@users.noreply.github.com> Date: Sat, 9 Mar 2024 08:57:04 -0500 Subject: [PATCH 2/2] Keep None subtitle at top --- components/manager/ViewCreator.bs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/components/manager/ViewCreator.bs b/components/manager/ViewCreator.bs index 646681b0d..c2efcd07c 100644 --- a/components/manager/ViewCreator.bs +++ b/components/manager/ViewCreator.bs @@ -65,16 +65,8 @@ end sub ' User requested subtitle selection popup sub onSelectSubtitlePressed() - ' Manually create the None option subtitleData = { - data: [{ - "Index": -1, - "IsExternal": false, - "Track": { - "description": "None" - }, - "Type": "subtitleselection" - }] + data: [] } for each item in m.view.fullSubtitleData @@ -108,6 +100,16 @@ sub onSelectSubtitlePressed() end if end for + ' Manually create the None option and place at top + subtitleData.data.Unshift({ + "Index": -1, + "IsExternal": false, + "Track": { + "description": "None" + }, + "Type": "subtitleselection" + }) + m.global.sceneManager.callFunc("radioDialog", tr("Select Subtitles"), subtitleData) m.global.sceneManager.observeField("returnData", "onSelectionMade") end sub