Skip to content

Commit

Permalink
fix: incorrect track selection status
Browse files Browse the repository at this point in the history
Avoid showing the selection status of secondary subtitle in the subtitle menu at the same time
  • Loading branch information
dyphire committed May 5, 2024
1 parent e6396f2 commit 0af7f61
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/uosc/lib/menus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ function create_select_tracklist_type_menu_opener(menu_title, track_type, track_
items[#items].separator = true
end

local track_prop_index = tonumber(mp.get_property(track_prop))
local first_item_index = #items + 1
local active_index = nil
local disabled_item = nil
Expand Down Expand Up @@ -148,10 +149,10 @@ function create_select_tracklist_type_menu_opener(menu_title, track_type, track_
title = (track.title and track.title or t('Track %s', track.id)),
hint = table.concat(hint_values, ', '),
value = track.id,
active = track.selected,
active = track.selected and track.id == track_prop_index,
}

if track.selected then
if track.selected and track.id == track_prop_index then
if disabled_item then disabled_item.active = false end
active_index = #items
end
Expand Down

0 comments on commit 0af7f61

Please sign in to comment.