Warning, /plasma-bigscreen/plasma-remotecontrollers/kcm/ui/+mediacenter/DeviceSetupView.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: 2015 Aleix Pol Gonzalez <aleixpol@kde.org> 0004 0005 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 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 Qt5Compat.GraphicalEffects 0017 0018 Rectangle { 0019 id: deviceView 0020 color: Kirigami.Theme.backgroundColor 0021 property QtObject currentDevice 0022 property var deviceType 0023 property bool ignoreEvent: false 0024 0025 onIgnoreEventChanged: { 0026 if (ignoreEvent) { 0027 ignoreEventResetTimer.start() 0028 } 0029 } 0030 0031 Timer { 0032 id: ignoreEventResetTimer 0033 interval: 200 0034 onTriggered: { 0035 deviceView.ignoreEvent = false 0036 } 0037 } 0038 0039 onActiveFocusChanged: { 0040 if(activeFocus){ 0041 deviceMapView.forceActiveFocus() 0042 } 0043 } 0044 0045 ColumnLayout { 0046 id: colLayoutSettingsItem 0047 clip: true 0048 0049 anchors { 0050 top: parent.top 0051 left: parent.left 0052 right: parent.right 0053 bottom: headerAreaSettingsItem.top 0054 margins: Kirigami.Units.largeSpacing * 2 0055 } 0056 0057 Item { 0058 Layout.fillWidth: true 0059 Layout.preferredHeight: parent.height * 0.10 0060 } 0061 0062 Item { 0063 Layout.fillWidth: true 0064 Layout.preferredHeight: dIcon.height + (label2.height + Kirigami.Units.largeSpacing * 2) 0065 Layout.alignment: Qt.AlignTop 0066 0067 Rectangle { 0068 id: dIcon 0069 anchors.top: headrSept.bottom 0070 anchors.topMargin: Kirigami.Units.largeSpacing 0071 anchors.horizontalCenter: parent.horizontalCenter 0072 width: Kirigami.Units.iconSizes.huge 0073 height: width 0074 radius: 100 0075 color: Kirigami.Theme.backgroundColor 0076 0077 Kirigami.Icon { 0078 id: deviceIconStatus 0079 anchors.centerIn: parent 0080 width: Kirigami.Units.iconSizes.large 0081 height: width 0082 source: currentDevice.deviceIconName 0083 } 0084 } 0085 0086 Kirigami.Heading { 0087 id: label2 0088 width: parent.width 0089 anchors.top: dIcon.bottom 0090 anchors.topMargin: Kirigami.Units.largeSpacing 0091 horizontalAlignment: Text.AlignHCenter 0092 wrapMode: Text.WordWrap 0093 level: 2 0094 maximumLineCount: 2 0095 elide: Text.ElideRight 0096 color: PlasmaCore.ColorScope.textColor 0097 text: i18n(currentDevice.deviceName) 0098 } 0099 0100 Kirigami.Separator { 0101 id: lblSept2 0102 anchors.top: label2.bottom 0103 anchors.topMargin: Kirigami.Units.smallSpacing 0104 height: 1 0105 width: parent.width 0106 } 0107 } 0108 0109 DeviceMap { 0110 id: deviceMapView 0111 Layout.fillWidth: true 0112 Layout.fillHeight: true 0113 Layout.alignment: Qt.AlignTop 0114 deviceType: deviceView.deviceType 0115 } 0116 } 0117 0118 RowLayout { 0119 id: headerAreaSettingsItem 0120 anchors.bottom: parent.bottom 0121 anchors.left: parent.left 0122 anchors.right: parent.right 0123 anchors.margins: Kirigami.Units.largeSpacing * 2 0124 height: Kirigami.Units.gridUnit * 2 0125 0126 PlasmaComponents2.Button { 0127 id: backBtnSettingsItem 0128 iconSource: "arrow-left" 0129 Layout.alignment: Qt.AlignLeft 0130 0131 KeyNavigation.up: deviceMapView 0132 KeyNavigation.down: deviceMapView 0133 0134 PlasmaComponents2.Highlight { 0135 z: -2 0136 anchors.fill: parent 0137 anchors.margins: -Kirigami.Units.gridUnit / 4 0138 visible: backBtnSettingsItem.activeFocus ? 1 : 0 0139 } 0140 0141 Keys.onReturnPressed: { 0142 clicked() 0143 } 0144 0145 onClicked: { 0146 connectionView.forceActiveFocus() 0147 } 0148 } 0149 0150 Label { 0151 id: backbtnlabelHeading 0152 text: i18n("Go back [←] to return to device selection") 0153 wrapMode: Text.WordWrap 0154 maximumLineCount: 2 0155 Layout.fillWidth: true 0156 Layout.alignment: Qt.AlignRight 0157 } 0158 } 0159 }