status-desktop/ui/app/AppLayouts/Onboarding/views/CreatePasswordView.qml
Noelia 94910e9554 fix(Onboarding): Give consistency to Create / Confirm password view font-size
Updated `Create` and `Confirm` password views according to new design decisions taken to give consistency to the onboarding screens (related to font-size).

Updated related squish test cases: Screenshots updated with new font-size and refactored some objectNames and objects that where using `text` property instead of `objectName`.

Updated `Input` components to `StatusPasswordInput` ones.

Fixes #7447
2022-10-13 16:15:36 +02:00

64 lines
1.7 KiB
QML

import QtQuick 2.0
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.12
import StatusQ.Controls 0.1
import StatusQ.Core.Theme 0.1
import StatusQ.Core.Utils 0.1 as StatusQUtils
import utils 1.0
import shared.views 1.0
import "../../Profile/views"
import "../controls"
import "../stores"
Item {
id: root
property StartupStore startupStore
Component.onCompleted: {
view.newPswText = root.startupStore.getPassword()
view.confirmationPswText = root.startupStore.getPassword()
d.forcePasswordInputFocus()
}
QtObject {
id: d
readonly property int zBehind: 1
readonly property int zFront: 100
function submit() {
root.startupStore.setDefaultWalletEmoji(StatusQUtils.Emoji.getRandomEmoji(StatusQUtils.Emoji.size.verySmall))
root.startupStore.setPassword(view.newPswText)
root.startupStore.doPrimaryAction()
}
function forcePasswordInputFocus() { view.forceNewPswInputFocus() }
}
ColumnLayout {
spacing: Style.current.bigPadding
anchors.centerIn: parent
width: 416
height: 460
z: view.zFront
PasswordView {
id: view
Layout.fillWidth: true
Layout.fillHeight: true
passwordStrengthScoreFunction: root.startupStore.getPasswordStrengthScore
highSizeIntro: true
onReturnPressed: { if(view.ready) d.submit() }
}
StatusButton {
id: submitBtn
objectName: "onboardingCreatePasswordButton"
z: d.zFront
Layout.alignment: Qt.AlignHCenter
text: qsTr("Create password")
enabled: view.ready
onClicked: { d.submit() }
}
}
}