Skip to content

Commit

Permalink
Move selected subtitle to top of selection menu
Browse files Browse the repository at this point in the history
  • Loading branch information
1hitsong committed Dec 30, 2023
1 parent 0d66a4b commit 3c24b94
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions components/manager/ViewCreator.bs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,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,
Expand Down Expand Up @@ -69,7 +69,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)
Expand Down

0 comments on commit 3c24b94

Please sign in to comment.