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.
This commit is contained in:
Joshua Goins
2024-07-25 19:24:10 -04:00
parent d43aa169c3
commit a64c1b8eab

View File

@@ -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"