qml: 2fa: make it possible to copy 2fa secret

The 2fa secret is not selectable or copyable, this is very inconveniant
when setting up a new 2fa wallet as the user has to somehow manually
write the secret e.g. on a paper to then enter it again in their 2fa
app. This makes the secret string copyable by clicking on it.
This commit is contained in:
f321x
2026-03-24 14:24:29 +01:00
parent 3cf2c325d5
commit 37159e47a2
@@ -42,15 +42,27 @@ WizardComponent {
render: plugin.otpSecret
}
TextHighlightPane {
Item {
Layout.alignment: Qt.AlignHCenter
visible: plugin.otpSecret
implicitWidth: otpSecretPane.implicitWidth
implicitHeight: otpSecretPane.implicitHeight
TextHighlightPane {
id: otpSecretPane
Label {
text: plugin.otpSecret
font.family: FixedFont
font.bold: true
}
}
MouseArea {
anchors.fill: parent
onClicked: {
AppController.textToClipboard(plugin.otpSecret)
toaster.show(otpSecretPane, qsTr('Copied!'))
}
}
}
Label {
Layout.fillWidth: true
@@ -118,6 +130,10 @@ WizardComponent {
otp_auth.forceActiveFocus()
}
Toaster {
id: toaster
}
Connections {
target: plugin
function onOtpError(message) {