UX improvements in wizard

- password page styling
- tab navigation / focus on load
- click language loads next page
This commit is contained in:
Jacob Brydolf 2016-10-01 03:05:26 +02:00 committed by Ilya Kitaev
parent fab66fec38
commit bd8646dd19
3 changed files with 36 additions and 19 deletions

View file

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

View file

@ -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)
}

View file

@ -163,6 +163,7 @@ Item {
if (data !== null || data !== undefined) {
var locale = data.locale
translationManager.setLanguage(locale.split("_")[0]);
wizard.switchPage(true)
}
}
}