Move remaining code to app module

There's still some stuff that could potentially go elsewhere but I think it's enough for now.
This commit is contained in:
James Graham
2025-04-18 09:26:17 +00:00
parent 0708f022bc
commit b6791485c4
124 changed files with 406 additions and 403 deletions

View File

@@ -0,0 +1,50 @@
// SPDX-FileCopyrightText: 2023 Tobias Fella <tobias.fella@kde.org>
// SPDX-License-Identifier: LGPL-2.0-or-later
import QtQuick
import org.kde.kirigamiaddons.labs.components as Components
import org.kde.kirigami as Kirigami
import org.kde.prison
Components.AbstractMaximizeComponent {
id: root
required property string text
property color avatarColor
required property url avatarSource
onOpened: forceActiveFocus()
Shortcut {
sequences: [StandardKey.Cancel]
onActivated: root.close()
}
leading: Components.Avatar {
id: userAvatar
implicitWidth: Kirigami.Units.iconSizes.medium
implicitHeight: Kirigami.Units.iconSizes.medium
name: root.title
source: root.avatarSource
color: root.avatarColor
}
content: Item {
Keys.onEscapePressed: root.close()
Barcode {
barcodeType: Barcode.QRCode
content: root.text
height: Math.min(parent.height, Kirigami.Units.gridUnit * 20)
width: height
anchors.centerIn: parent
}
MouseArea {
id: closeArea
anchors.fill: parent
acceptedButtons: Qt.LeftButton
onClicked: root.close()
}
}
}