From bd8646dd194771a9ff39bc75530d169a6d570ef6 Mon Sep 17 00:00:00 2001 From: Jacob Brydolf Date: Sat, 1 Oct 2016 03:05:26 +0200 Subject: [PATCH] UX improvements in wizard - password page styling - tab navigation / focus on load - click language loads next page --- wizard/WizardPassword.qml | 30 ++++++++++++++++++------------ wizard/WizardPasswordInput.qml | 24 +++++++++++++++++------- wizard/WizardWelcome.qml | 1 + 3 files changed, 36 insertions(+), 19 deletions(-) diff --git a/wizard/WizardPassword.qml b/wizard/WizardPassword.qml index 8318a785..476c5742 100644 --- a/wizard/WizardPassword.qml +++ b/wizard/WizardPassword.qml @@ -52,6 +52,8 @@ Item { } else { passwordPage.titleText = qsTr("Now that your wallet has been restored, please set a password for the wallet") + translationManager.emptyString } + + passwordItem.focus = true; } function onPageClosed(settingsObject) { @@ -146,30 +148,34 @@ Item { anchors.topMargin: 24 width: 300 height: 62 + placeholderText : qsTr("Password") + translationManager.emptyString; + KeyNavigation.tab: retypePasswordItem onChanged: handlePassword() + } + WizardPasswordInput { + id: retypePasswordItem + anchors.top: passwordItem.bottom + anchors.horizontalCenter: parent.horizontalCenter + anchors.topMargin: 24 + width: 300 + height: 62 + placeholderText : qsTr("Confirm password") + translationManager.emptyString; + KeyNavigation.tab: passwordItem + onChanged: handlePassword() + } PrivacyLevelSmall { id: privacyLevel anchors.left: parent.left anchors.right: parent.right - anchors.top: passwordItem.bottom - anchors.topMargin: 24 + anchors.top: retypePasswordItem.bottom + anchors.topMargin: 60 background: "#F0EEEE" interactive: false } - WizardPasswordInput { - id: retypePasswordItem - anchors.top: privacyLevel.bottom - anchors.horizontalCenter: parent.horizontalCenter - anchors.topMargin: 24 - width: 300 - height: 62 - onChanged: handlePassword() - } - Component.onCompleted: { console.log } diff --git a/wizard/WizardPasswordInput.qml b/wizard/WizardPasswordInput.qml index 82597421..00201ecf 100644 --- a/wizard/WizardPasswordInput.qml +++ b/wizard/WizardPasswordInput.qml @@ -27,24 +27,34 @@ // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import QtQuick 2.0 +import QtQuick.Controls 1.4 +import QtQuick.Controls.Styles 1.4 -Item { +FocusScope { property alias password: password.text + property alias placeholderText: password.placeholderText signal changed(string password) - TextInput { + TextField { id : password + focus:true anchors.fill: parent - horizontalAlignment: TextInput.AlignHCenter + horizontalAlignment: TextInput.AlignLeft verticalAlignment: TextInput.AlignVCenter font.family: "Arial" font.pixelSize: 32 - renderType: Text.NativeRendering - color: "#35B05A" - passwordCharacter: "•" echoMode: TextInput.Password - focus: true + style: TextFieldStyle { + renderType: Text.NativeRendering + textColor: "#35B05A" + passwordCharacter: "•" + background: Rectangle { + radius: 0 + border.width: 0 + } + } + Keys.onReleased: { changed(text) } diff --git a/wizard/WizardWelcome.qml b/wizard/WizardWelcome.qml index 46448e2c..ef97f984 100644 --- a/wizard/WizardWelcome.qml +++ b/wizard/WizardWelcome.qml @@ -163,6 +163,7 @@ Item { if (data !== null || data !== undefined) { var locale = data.locale translationManager.setLanguage(locale.split("_")[0]); + wizard.switchPage(true) } } }