Warning, /plasma/plasma-bigscreen/kcms/bigscreen-settings/ui/delegates/ThemeDelegate.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2019 Aditya Mehra <aix.m@outlook.com>
0003     SPDX-FileCopyrightText: 2019 Marco Martin <mart@kde.org>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 import QtQuick 2.14
0009 import QtQuick.Layouts 1.14
0010 import QtQuick.Controls 2.14
0011 import org.kde.plasma.components 3.0 as PlasmaComponents
0012 import org.kde.kirigami as Kirigami
0013 import org.kde.mycroft.bigscreen 1.0 as BigScreen
0014 import Qt5Compat.GraphicalEffects
0015 
0016 BigScreen.AbstractDelegate {
0017     id: delegate
0018     implicitWidth: listView.cellWidth * 2
0019     implicitHeight: textLayout.implicitHeight + nameLabel.height + Kirigami.Units.largeSpacing * 2
0020 
0021 
0022     Behavior on implicitWidth {
0023         NumberAnimation {
0024             duration: Kirigami.Units.longDuration
0025             easing.type: Easing.InOutQuad
0026         }
0027     }
0028 
0029     contentItem: Item {
0030         id: connectionItemLayout
0031 
0032         ColumnLayout {
0033             id: textLayout
0034 
0035             anchors {
0036                 fill: parent
0037                 leftMargin: Kirigami.Units.smallSpacing
0038             }
0039 
0040             Item {
0041                 id: connectionSvgIcon
0042                 width: parent.width
0043                 height: width
0044                 ThemePreview {
0045                     id: preview
0046                     anchors.fill: parent
0047                     themeName: model.pluginNameRole
0048                 }
0049             }
0050 
0051             PlasmaComponents.Label {
0052                 id: nameLabel
0053                 Layout.fillWidth: true
0054                 visible: text.length > 0
0055                 elide: Text.ElideRight
0056                 wrapMode: Text.WordWrap
0057                 horizontalAlignment: Text.AlignHCenter
0058                 maximumLineCount: 2
0059                 color: Kirigami.Theme.textColor
0060                 textFormat: Text.PlainText
0061                 text: model.display
0062             }
0063         }
0064 
0065         Kirigami.Icon {
0066             id: dIcon
0067             anchors.bottom: parent.bottom
0068             anchors.bottomMargin: -Kirigami.Units.smallSpacing
0069             anchors.right: parent.right
0070             anchors.rightMargin: -Kirigami.Units.smallSpacing
0071             width: Kirigami.Units.iconSizes.smallMedium
0072             height: width
0073             source: Qt.resolvedUrl("../images/green-tick-thick.svg")
0074             visible:  kcm.themeName === model.packageNameRole
0075         }
0076     }
0077 
0078     Keys.onReturnPressed: clicked()
0079 
0080     onClicked: {
0081         setTheme(model.packageNameRole)
0082     }
0083 }