Warning, /multimedia/haruna/src/qml/Settings/PlaylistSettings.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  * SPDX-FileCopyrightText: 2020 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.Layouts
0009 import QtQuick.Controls
0010 
0011 import org.kde.kirigami as Kirigami
0012 import org.kde.haruna
0013 import org.kde.haruna.settings
0014 
0015 SettingsBasePage {
0016     id: root
0017 
0018     hasHelp: false
0019     helpFile: ""
0020 
0021     GridLayout {
0022         id: content
0023 
0024         columns: 2
0025 
0026         Label {
0027             text: i18nc("@label:listbox", "Position")
0028             Layout.alignment: Qt.AlignRight
0029         }
0030 
0031         ComboBox {
0032             textRole: "key"
0033             model: ListModel {
0034                 ListElement { key: "Left"; value: "left" }
0035                 ListElement { key: "Right"; value: "right" }
0036             }
0037             Component.onCompleted: {
0038                 for (let i = 0; i < model.count; ++i) {
0039                     if (model.get(i).value === PlaylistSettings.position) {
0040                         currentIndex = i
0041                         break
0042                     }
0043                 }
0044             }
0045             onActivated: function(index) {
0046                 PlaylistSettings.position = model.get(index).value
0047                 PlaylistSettings.save()
0048             }
0049         }
0050 
0051         Label {
0052             text: i18nc("@label:listbox", "Playlist style")
0053             Layout.alignment: Qt.AlignRight
0054         }
0055 
0056         ComboBox {
0057             textRole: "display"
0058             model: ListModel {
0059                 ListElement { display: "Default"; value: "default" }
0060                 ListElement { display: "With thumbnails"; value: "withThumbnails" }
0061                 ListElement { display: "Compact"; value: "compact" }
0062             }
0063             Component.onCompleted: {
0064                 for (let i = 0; i < model.count; ++i) {
0065                     if (model.get(i).value === PlaylistSettings.style) {
0066                         currentIndex = i
0067                         break
0068                     }
0069                 }
0070             }
0071             onActivated: function(index) {
0072                 PlaylistSettings.style = model.get(index).value
0073                 PlaylistSettings.save()
0074             }
0075         }
0076 
0077         Item { width: 1; height: 1 }
0078         CheckBox {
0079             checked: PlaylistSettings.showToolbar
0080             text: i18nc("@option:check", "Show toolbar")
0081             onCheckStateChanged: {
0082                 PlaylistSettings.showToolbar = checked
0083                 PlaylistSettings.save()
0084             }
0085         }
0086 
0087         Item { width: 1; height: 1 }
0088         CheckBox {
0089             checked: PlaylistSettings.overlayVideo
0090             text: i18nc("@option:check", "Overlay video")
0091             onCheckStateChanged: {
0092                 PlaylistSettings.overlayVideo = checked
0093                 PlaylistSettings.save()
0094             }
0095 
0096             ToolTip {
0097                 text: i18nc("@info:tooltip", "When checked the playlist goes on top of the video\nWhen unchecked the video is resized")
0098             }
0099         }
0100 
0101         Item { width: 1; height: 1 }
0102         CheckBox {
0103             checked: PlaylistSettings.showMediaTitle
0104             text: i18nc("@option:check", "Show media title instead of file name")
0105             onCheckStateChanged: {
0106                 PlaylistSettings.showMediaTitle = checked
0107                 PlaylistSettings.save()
0108             }
0109         }
0110 
0111         Item { width: 1; height: 1 }
0112         CheckBox {
0113             checked: PlaylistSettings.loadSiblings
0114             text: i18nc("@option:check", "Auto load videos from same folder")
0115             onCheckStateChanged: {
0116                 PlaylistSettings.loadSiblings = checked
0117                 PlaylistSettings.save()
0118             }
0119         }
0120 
0121         Item { width: 1; height: 1 }
0122         CheckBox {
0123             checked: PlaylistSettings.repeat
0124             text: i18nc("@option:check", "Repeat")
0125             onCheckStateChanged: {
0126                 PlaylistSettings.repeat = checked
0127                 PlaylistSettings.save()
0128             }
0129         }
0130 
0131         Item { width: 1; height: 1 }
0132         CheckBox {
0133             checked: PlaylistSettings.showRowNumber
0134             text: i18nc("@option:check", "Show row number")
0135             onCheckStateChanged: {
0136                 PlaylistSettings.showRowNumber = checked
0137                 PlaylistSettings.save()
0138             }
0139         }
0140 
0141         Item { width: 1; height: 1 }
0142         CheckBox {
0143             checked: PlaylistSettings.canToggleWithMouse
0144             text: i18nc("@option:check", "Toggle with mouse")
0145             onCheckStateChanged: {
0146                 PlaylistSettings.canToggleWithMouse = checked
0147                 PlaylistSettings.save()
0148             }
0149         }
0150 
0151         Item { width: 1; height: 1 }
0152         CheckBox {
0153             text: i18nc("@option:check", "Increase font size when fullscreen")
0154             checked: PlaylistSettings.bigFontFullscreen
0155             enabled: PlaylistSettings.style === "compact" ? false : true
0156             onCheckStateChanged: {
0157                 PlaylistSettings.bigFontFullscreen = checked
0158                 PlaylistSettings.save()
0159                 playlist.playlistView.forceLayout()
0160             }
0161         }
0162 
0163         Item { width: 1; height: 1 }
0164         CheckBox {
0165             checked: PlaylistSettings.rememberState
0166             text: i18nc("@option:check", "Remember last playlist state")
0167             onCheckStateChanged: {
0168                 PlaylistSettings.rememberState = checked
0169                 PlaylistSettings.save()
0170             }
0171 
0172             ToolTip {
0173                 text: i18nc("@info:tooltip", "When checked the playlist state (visible/hidden) "
0174                             + "is remembered across launches")
0175             }
0176         }
0177 
0178 
0179         Item {
0180             width: Kirigami.Units.gridUnit
0181             height: Kirigami.Units.gridUnit
0182         }
0183     }
0184 }