Warning, /plasma/plasma-bigscreen/kcms/kdeconnect/ui/delegates/PairRequest.qml is written in an unsupported language. File is not indexed.
0001 /*
0002 SPDX-FileCopyrightText: 2019 Aditya Mehra <aix.m@outlook.com>
0003
0004 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005 */
0006
0007 import QtQuick 2.14
0008 import QtQuick.Layouts 1.14
0009 import QtQuick.Controls 2.14
0010 import org.kde.plasma.components 3.0 as PlasmaComponents
0011 import org.kde.kirigami 2.12 as Kirigami
0012 import org.kde.kdeconnect 1.0
0013
0014 Item {
0015 id: pairDevice
0016 Layout.fillWidth: true
0017 Layout.fillHeight: true
0018
0019 onActiveFocusChanged: {
0020 acceptBtn.forceActiveFocus()
0021 }
0022
0023 ColumnLayout {
0024 anchors.fill: parent
0025
0026 PlasmaComponents.Label {
0027 Layout.fillWidth: true
0028 horizontalAlignment: Text.AlignHCenter
0029 text: i18n("This device is requesting to be paired")
0030 }
0031
0032 Button {
0033 id: acceptBtn
0034 Layout.fillWidth: true
0035 Layout.preferredHeight: Kirigami.Units.gridUnit * 2
0036 Kirigami.Theme.colorSet: Kirigami.Theme.Button
0037
0038 KeyNavigation.up: backBtnSettingsItem
0039 KeyNavigation.down: rejectBtn
0040
0041 Keys.onReturnPressed: {
0042 clicked()
0043 }
0044
0045 onClicked: deviceView.currentDevice.acceptPairing()
0046
0047 background: Rectangle {
0048 color: acceptBtn.activeFocus ? Kirigami.Theme.highlightColor : Kirigami.Theme.backgroundColor
0049 border.width: 0.75
0050 border.color: Qt.tint(Kirigami.Theme.textColor, Qt.rgba(Kirigami.Theme.backgroundColor.r, Kirigami.Theme.backgroundColor.g, Kirigami.Theme.backgroundColor.b, 0.8))
0051 }
0052
0053 contentItem: Item {
0054 RowLayout {
0055 anchors.centerIn: parent
0056
0057 Kirigami.Icon {
0058 Layout.preferredWidth: PlasmaCore.Units.iconSizes.small
0059 Layout.preferredHeight: PlasmaCore.Units.iconSizes.small
0060 source: "dialog-ok"
0061 }
0062 PlasmaComponents.Label {
0063 text: i18n("Accept")
0064 }
0065 }
0066 }
0067 }
0068
0069 Button {
0070 id: rejectBtn
0071 Layout.fillWidth: true
0072 Layout.preferredHeight: Kirigami.Units.gridUnit * 2
0073 Kirigami.Theme.colorSet: Kirigami.Theme.Button
0074
0075 KeyNavigation.up: acceptBtn
0076
0077 Keys.onReturnPressed: {
0078 clicked()
0079 }
0080
0081 onClicked: deviceView.currentDevice.rejectPairing()
0082
0083 background: Rectangle {
0084 color: rejectBtn.activeFocus ? Kirigami.Theme.highlightColor : Kirigami.Theme.backgroundColor
0085 border.width: 0.75
0086 border.color: Qt.tint(Kirigami.Theme.textColor, Qt.rgba(Kirigami.Theme.backgroundColor.r, Kirigami.Theme.backgroundColor.g, Kirigami.Theme.backgroundColor.b, 0.8))
0087 }
0088
0089 contentItem: Item {
0090 RowLayout {
0091 anchors.centerIn: parent
0092
0093 Kirigami.Icon {
0094 Layout.preferredWidth: PlasmaCore.Units.iconSizes.small
0095 Layout.preferredHeight: PlasmaCore.Units.iconSizes.small
0096 source: "dialog-cancel"
0097 }
0098 PlasmaComponents.Label {
0099 text: i18n("Reject")
0100 }
0101 }
0102 }
0103 }
0104 }
0105 }