Warning, /plasma/plasma-nm/applet/contents/ui/ShowQR.qml is written in an unsupported language. File is not indexed.
0001 /* 0002 SPDX-FileCopyrightText: 2019 Aleix Pol Gonzalez <aleixpol@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0005 */ 0006 0007 import QtQuick 2.15 0008 import QtQuick.Layouts 1.15 0009 import QtQuick.Window 2.15 0010 0011 import org.kde.plasma.core 2.1 as PlasmaCore 0012 import org.kde.plasma.components 3.0 as PlasmaComponents3 0013 import org.kde.prison 1.0 as Prison 0014 0015 Window { 0016 id: window 0017 color: Qt.rgba(0, 0, 0, 0.3) 0018 flags: Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint 0019 0020 property alias content: dataInput.content 0021 0022 function destroyWindow() { 0023 window.close(); 0024 window.destroy(); 0025 } 0026 0027 Shortcut { 0028 sequences: [StandardKey.Back, StandardKey.Cancel, StandardKey.Close, StandardKey.Delete, StandardKey.Quit] 0029 onActivated: window.destroyWindow() 0030 } 0031 0032 MouseArea { 0033 anchors.fill: parent 0034 0035 onClicked: window.destroyWindow() 0036 0037 Prison.Barcode { 0038 id: dataInput 0039 0040 anchors { 0041 fill: parent 0042 margins: PlasmaCore.Units.smallSpacing * 8 0043 } 0044 0045 barcodeType: "QRCode" 0046 } 0047 0048 // Because some people like to have something visible to click on, 0049 // and to them, it might not be obvious that you close the overlay 0050 // by clicking anywhere on it. 0051 PlasmaComponents3.Button { 0052 anchors { 0053 right: parent.right 0054 top: parent.top 0055 } 0056 0057 icon.name: "window-close" 0058 onClicked: window.destroyWindow() 0059 } 0060 } 0061 }