Warning, /network/neochat/src/qml/QrCodeMaximizeComponent.qml is written in an unsupported language. File is not indexed.

0001 // SPDX-FileCopyrightText: 2023 Tobias Fella <tobias.fella@kde.org>
0002 // SPDX-License-Identifier: LGPL-2.0-or-later
0003 
0004 import QtQuick
0005 import QtQuick.Controls as QQC2
0006 import QtQuick.Layouts
0007 
0008 import org.kde.kirigamiaddons.labs.components as Components
0009 import org.kde.kirigami as Kirigami
0010 import org.kde.prison
0011 
0012 Components.AbstractMaximizeComponent {
0013     id: root
0014 
0015     required property string text
0016     required property color avatarColor
0017     required property string avatarSource
0018 
0019     Shortcut {
0020         sequences: [StandardKey.Cancel]
0021         onActivated: root.close()
0022     }
0023 
0024     leading: Components.Avatar {
0025         id: userAvatar
0026         implicitWidth: Kirigami.Units.iconSizes.medium
0027         implicitHeight: Kirigami.Units.iconSizes.medium
0028 
0029         name: root.title
0030         source: root.avatarSource
0031         color: root.avatarColor
0032     }
0033 
0034     content: Item {
0035         Keys.onEscapePressed: root.close()
0036         Barcode {
0037             barcodeType: Barcode.QRCode
0038             content: root.text
0039             height: Math.min(parent.height, Kirigami.Units.gridUnit * 20)
0040             width: height
0041             anchors.centerIn: parent
0042         }
0043         MouseArea {
0044             id: closeArea
0045             anchors.fill: parent
0046             acceptedButtons: Qt.LeftButton
0047             onClicked: root.close()
0048         }
0049     }
0050 }