From 1210ef5f81c5e2d2f9a0c8a60d12a8c7d783b9ce Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Thu, 9 Mar 2023 16:13:24 +0100 Subject: [PATCH] qml: various styling --- electrum/gui/qml/components/OpenChannelDialog.qml | 1 + electrum/gui/qml/components/OpenWalletDialog.qml | 4 +++- .../gui/qml/components/controls/ChannelDelegate.qml | 2 +- .../gui/qml/components/controls/PasswordField.qml | 7 +++++++ .../gui/qml/components/wizard/WCWalletPassword.qml | 11 ++++++++--- 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/electrum/gui/qml/components/OpenChannelDialog.qml b/electrum/gui/qml/components/OpenChannelDialog.qml index 642e98ca6..f4cb089e3 100644 --- a/electrum/gui/qml/components/OpenChannelDialog.qml +++ b/electrum/gui/qml/components/OpenChannelDialog.qml @@ -169,6 +169,7 @@ ElDialog { FlatButton { Layout.fillWidth: true text: qsTr('Open Channel') + icon.source: '../../icons/confirmed.png' enabled: channelopener.valid onClicked: channelopener.open_channel() } diff --git a/electrum/gui/qml/components/OpenWalletDialog.qml b/electrum/gui/qml/components/OpenWalletDialog.qml index 9fcd75f84..a299c24e9 100644 --- a/electrum/gui/qml/components/OpenWalletDialog.qml +++ b/electrum/gui/qml/components/OpenWalletDialog.qml @@ -44,7 +44,9 @@ ElDialog { InfoTextArea { id: notice - text: qsTr("Wallet %1 requires password to unlock").arg(name) + text: Daemon.singlePasswordEnabled + ? qsTr('Please enter password') + : qsTr('Wallet %1 requires password to unlock').arg(name) visible: wallet_db.needsPassword iconStyle: InfoTextArea.IconStyle.Warn Layout.fillWidth: true diff --git a/electrum/gui/qml/components/controls/ChannelDelegate.qml b/electrum/gui/qml/components/controls/ChannelDelegate.qml index 54b8a05a2..962fa7164 100644 --- a/electrum/gui/qml/components/controls/ChannelDelegate.qml +++ b/electrum/gui/qml/components/controls/ChannelDelegate.qml @@ -22,7 +22,7 @@ ItemDelegate { left: parent.left right: parent.right leftMargin: constants.paddingSmall - rightMargin: constants.paddingSmall + rightMargin: constants.paddingMedium } columns: 2 diff --git a/electrum/gui/qml/components/controls/PasswordField.qml b/electrum/gui/qml/components/controls/PasswordField.qml index 019a928ba..fed6be43e 100644 --- a/electrum/gui/qml/components/controls/PasswordField.qml +++ b/electrum/gui/qml/components/controls/PasswordField.qml @@ -6,6 +6,9 @@ RowLayout { id: root property alias text: password_tf.text property alias tf: password_tf + property alias echoMode: password_tf.echoMode + property bool showReveal: true + signal accepted TextField { @@ -17,6 +20,10 @@ RowLayout { onAccepted: root.accepted() } ToolButton { + id: revealButton + enabled: root.showReveal + opacity: root.showReveal ? 1 : 0 + icon.source: '../../../icons/eye1.png' onClicked: { password_tf.echoMode = password_tf.echoMode == TextInput.Password ? TextInput.Normal : TextInput.Password diff --git a/electrum/gui/qml/components/wizard/WCWalletPassword.qml b/electrum/gui/qml/components/wizard/WCWalletPassword.qml index 5e4921ac5..3da0cec99 100644 --- a/electrum/gui/qml/components/wizard/WCWalletPassword.qml +++ b/electrum/gui/qml/components/wizard/WCWalletPassword.qml @@ -12,14 +12,19 @@ WizardComponent { wizard_data['encrypt'] = password1.text != '' } - GridLayout { - columns: 1 - Label { text: qsTr('Password protect wallet?') } + ColumnLayout { + Label { + text: Daemon.singlePasswordEnabled + ? qsTr('Enter password') + : qsTr('Enter password for %1').arg(wizard_data['wallet_name']) + } PasswordField { id: password1 } PasswordField { id: password2 + showReveal: false + echoMode: password1.echoMode } } }