From 67b57da402a849ecc2f94283513467c445bda409 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Tue, 30 Jan 2024 02:11:01 +0000 Subject: [PATCH] qml: WCHaveMasterKey: (fix) re-verify text in onTextChanged fixes https://github.com/spesmilo/electrum/issues/8853 This is a bit ugly, but activeFocus is declared as final and cannot be overridden directly... ``` 1.42 | W | gui.qml.qeapp | file:///home/user/wspace/electrum/electrum/gui/qml/components/controls/ElTextArea.qml:23:5: Cannot override FINAL property ``` --- electrum/gui/qml/components/controls/ElTextArea.qml | 1 + electrum/gui/qml/components/wizard/WCHaveMasterKey.qml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/electrum/gui/qml/components/controls/ElTextArea.qml b/electrum/gui/qml/components/controls/ElTextArea.qml index 7a90c4d65..eeb528abb 100644 --- a/electrum/gui/qml/components/controls/ElTextArea.qml +++ b/electrum/gui/qml/components/controls/ElTextArea.qml @@ -19,6 +19,7 @@ Flickable { property alias inputMethodHints: edit.inputMethodHints property alias placeholderText: edit.placeholderText property alias color: edit.color + readonly property bool anyActiveFocus: activeFocus || edit.activeFocus contentWidth: rootpane.width contentHeight: rootpane.height diff --git a/electrum/gui/qml/components/wizard/WCHaveMasterKey.qml b/electrum/gui/qml/components/wizard/WCHaveMasterKey.qml index c5a15c9ae..563109c26 100644 --- a/electrum/gui/qml/components/wizard/WCHaveMasterKey.qml +++ b/electrum/gui/qml/components/wizard/WCHaveMasterKey.qml @@ -129,8 +129,9 @@ WizardComponent { font.family: FixedFont wrapMode: TextEdit.WrapAnywhere onTextChanged: { - if (activeFocus) + if (anyActiveFocus) { verifyMasterKey(text) + } } inputMethodHints: Qt.ImhSensitiveData | Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase background: PaneInsetBackground {