Warning, /plasma-bigscreen/plasma-remotecontrollers/kcm/ui/+mediacenter/delegates/DeviceDelegate.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2020 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.core 2.0 as PlasmaCore
0012 import org.kde.kirigami 2.20 as Kirigami
0013 import org.kde.plasma.components 2.0 as PlasmaComponents2
0014 import org.kde.plasma.components 3.0 as PlasmaComponents
0015 import org.kde.mycroft.bigscreen 1.0 as BigScreen
0016 import QtGraphicalEffects 1.14
0017 
0018 BigScreen.AbstractDelegate {
0019     id: delegate
0020 
0021     implicitWidth: listView.cellWidth * 2
0022     implicitHeight: listView.height
0023     property QtObject device: model
0024     property var deviceType: model.deviceType
0025     
0026     Behavior on implicitWidth {
0027         NumberAnimation {
0028             duration: Kirigami.Units.longDuration
0029             easing.type: Easing.InOutQuad
0030         }
0031     }
0032     
0033     Keys.onReturnPressed: {
0034         clicked();
0035     }
0036     
0037     onClicked: {
0038         listView.currentIndex = index
0039         deviceSetupView.forceActiveFocus()
0040     }
0041 
0042     contentItem: Item {
0043         id: deviceItemLayout
0044         
0045         Item {
0046             id: deviceSvgIcon
0047             width: Kirigami.Units.iconSizes.huge
0048             height: width
0049             y: deviceItemLayout.height / 2 - deviceSvgIcon.height / 2
0050             
0051             Kirigami.Icon {
0052                 anchors.centerIn: parent
0053                 source: model.deviceIconName
0054                 width: Kirigami.Units.iconSizes.large
0055                 height: width
0056             }
0057         }
0058         
0059         ColumnLayout {
0060             id: textLayout
0061             
0062             anchors {
0063                 left: deviceSvgIcon.right
0064                 right: deviceItemLayout.right
0065                 top: deviceSvgIcon.top
0066                 bottom: deviceSvgIcon.bottom
0067                 leftMargin: Kirigami.Units.smallSpacing
0068             }
0069 
0070             PlasmaComponents.Label {
0071                 id: deviceNameLabel
0072                 Layout.fillWidth: true
0073                 visible: text.length > 0
0074                 elide: Text.ElideRight
0075                 wrapMode: Text.WordWrap
0076                 horizontalAlignment: Text.AlignHCenter
0077                 maximumLineCount: 2
0078                 textFormat: Text.PlainText
0079                 color: Kirigami.Theme.textColor
0080                 text: i18n(model.deviceName)
0081             }
0082         }
0083     }
0084 }