From a64c1b8eabf0149db457d9555f78e3473a489787 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Thu, 25 Jul 2024 19:24:10 -0400 Subject: [PATCH] Add a "Show QR code" to the account menu Making this a couple of clicks away under the account menu should make it easier to show the QR code without digging through the settings. --- src/qml/AccountMenu.qml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/qml/AccountMenu.qml b/src/qml/AccountMenu.qml index 60d83619f..e3e8434c0 100644 --- a/src/qml/AccountMenu.qml +++ b/src/qml/AccountMenu.qml @@ -19,6 +19,22 @@ QQC2.Menu { margins: Kirigami.Units.smallSpacing + QQC2.MenuItem { + text: i18nc("@action:button", "Show QR code") + icon.name: "view-barcode-qr-symbolic" + onTriggered: { + let qrMax = Qt.createComponent('org.kde.neochat', 'QrCodeMaximizeComponent').createObject(QQC2.Overlay.overlay, { + text: "https://matrix.to/#/" + root.connection.localUser.id, + title: root.connection.localUser.displayName, + subtitle: root.connection.localUser.id, + avatarSource: root.connection.makeMediaUrl(root.connection.localUser.avatarUrl) + }); + if (typeof root.closeDialog === "function") { + root.closeDialog(); + } + qrMax.open(); + } + } QQC2.MenuItem { text: i18n("Edit this account") icon.name: "document-edit"