Warning, /multimedia/haruna/src/qml/Haruna/Components/SubtitleTracksMenu.qml is written in an unsupported language. File is not indexed.
0001 /*
0002 * SPDX-FileCopyrightText: 2023 George Florea Bănuș <georgefb899@gmail.com>
0003 *
0004 * SPDX-License-Identifier: GPL-3.0-or-later
0005 */
0006
0007 import QtQuick
0008 import QtQuick.Controls
0009
0010 Menu {
0011 id: root
0012
0013 required property var model
0014 required property bool isPrimarySubtitleMenu
0015
0016 Repeater {
0017 model: root.model
0018 delegate: MenuItem {
0019 enabled: isPrimarySubtitleMenu
0020 ? model.id !== mpv.secondarySubtitleId || model.id === 0
0021 : model.id !== mpv.subtitleId || model.id === 0
0022 checkable: true
0023 checked: isPrimarySubtitleMenu
0024 ? model.id === mpv.subtitleId
0025 : model.id === mpv.secondarySubtitleId
0026 text: model.text
0027 onTriggered: {
0028 if (isPrimarySubtitleMenu) {
0029 mpv.subtitleId = model.id
0030 } else {
0031 mpv.secondarySubtitleId = model.id
0032 }
0033 }
0034 }
0035 }
0036 }