2022-03-07 22:59:38 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.12
|
|
|
|
import QtQuick.Layouts 1.12
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
|
|
|
|
import shared.panels 1.0
|
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
import "../controls"
|
|
|
|
import "../panels"
|
|
|
|
import "../stores"
|
|
|
|
|
2022-07-20 12:34:44 +00:00
|
|
|
Item {
|
2022-03-07 22:59:38 +00:00
|
|
|
id: root
|
|
|
|
|
2022-07-20 12:34:44 +00:00
|
|
|
property StartupStore startupStore
|
2022-03-07 22:59:38 +00:00
|
|
|
|
2023-04-03 09:15:34 +00:00
|
|
|
Component.onCompleted: {
|
|
|
|
button.forceActiveFocus()
|
|
|
|
}
|
|
|
|
|
2022-03-07 22:59:38 +00:00
|
|
|
Item {
|
|
|
|
id: container
|
|
|
|
enabled: !dimBackground.active
|
|
|
|
anchors.centerIn: parent
|
|
|
|
width: 425
|
|
|
|
height: {
|
|
|
|
let h = 0
|
|
|
|
const children = this.children
|
|
|
|
Object.keys(children).forEach(function (key) {
|
|
|
|
const child = children[key]
|
|
|
|
h += child.height + Style.current.padding
|
|
|
|
})
|
|
|
|
return h
|
|
|
|
}
|
|
|
|
Image {
|
|
|
|
id: keysImg
|
2022-05-24 10:46:27 +00:00
|
|
|
width: 188
|
|
|
|
height: 185
|
2022-03-07 22:59:38 +00:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
anchors.top: parent.top
|
|
|
|
fillMode: Image.PreserveAspectFit
|
2022-04-07 11:12:29 +00:00
|
|
|
antialiasing: true
|
|
|
|
source: Style.png("onboarding/fingerprint@2x")
|
2022-03-07 22:59:38 +00:00
|
|
|
mipmap: true
|
2023-04-26 15:33:24 +00:00
|
|
|
cache: false
|
2022-03-07 22:59:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
id: txtTitle
|
|
|
|
text: qsTr("Biometrics")
|
|
|
|
anchors.topMargin: Style.current.padding
|
|
|
|
font.bold: true
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
anchors.top: keysImg.bottom
|
|
|
|
font.letterSpacing: -0.2
|
|
|
|
font.pixelSize: 22
|
|
|
|
}
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
id: txtDesc
|
|
|
|
width: 426
|
|
|
|
anchors.top: txtTitle.bottom
|
|
|
|
anchors.topMargin: Style.current.padding
|
|
|
|
color: Style.current.secondaryText
|
2022-07-21 11:29:18 +00:00
|
|
|
text: root.startupStore.currentStartupState.flowType === Constants.startupFlow.firstRunNewUserNewKeycardKeys ||
|
|
|
|
root.startupStore.currentStartupState.flowType === Constants.startupFlow.firstRunNewUserImportSeedPhraseIntoKeycard ||
|
|
|
|
root.startupStore.currentStartupState.flowType === Constants.startupFlow.firstRunOldUserKeycardImport?
|
|
|
|
qsTr("Would you like to use TouchID instead of a PIN code\nto login to Status using your Keycard?") :
|
|
|
|
qsTr("Would you like to use Touch ID\nto login to Status?")
|
2022-03-07 22:59:38 +00:00
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
font.pixelSize: 15
|
|
|
|
}
|
|
|
|
ColumnLayout {
|
|
|
|
anchors.topMargin: 40
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
anchors.top: txtDesc.bottom
|
|
|
|
spacing: Style.current.bigPadding
|
|
|
|
StatusButton {
|
|
|
|
id: button
|
2023-09-21 14:41:49 +00:00
|
|
|
objectName: "touchIdYesUseTouchIDButton"
|
2022-03-07 22:59:38 +00:00
|
|
|
Layout.alignment: Qt.AlignHCenter
|
2022-05-03 07:28:16 +00:00
|
|
|
text: qsTr("Yes, use Touch ID")
|
2022-03-07 22:59:38 +00:00
|
|
|
onClicked: {
|
2022-07-20 12:34:44 +00:00
|
|
|
dimBackground.active = true
|
|
|
|
root.startupStore.doPrimaryAction()
|
2022-03-07 22:59:38 +00:00
|
|
|
}
|
2023-04-03 09:15:34 +00:00
|
|
|
Keys.onPressed: {
|
|
|
|
if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
|
|
|
|
event.accepted = true
|
|
|
|
root.startupStore.doPrimaryAction()
|
|
|
|
}
|
|
|
|
}
|
2022-03-07 22:59:38 +00:00
|
|
|
}
|
|
|
|
StatusBaseText {
|
|
|
|
id: keycardLink
|
2022-07-29 22:51:34 +00:00
|
|
|
objectName: "touchIdIPreferToUseMyPasswordText"
|
2022-03-07 22:59:38 +00:00
|
|
|
Layout.alignment: Qt.AlignHCenter
|
|
|
|
color: Theme.palette.primaryColor1
|
2022-07-21 11:29:18 +00:00
|
|
|
text: root.startupStore.currentStartupState.flowType === Constants.startupFlow.firstRunNewUserNewKeycardKeys ||
|
|
|
|
root.startupStore.currentStartupState.flowType === Constants.startupFlow.firstRunNewUserImportSeedPhraseIntoKeycard ||
|
|
|
|
root.startupStore.currentStartupState.flowType === Constants.startupFlow.firstRunOldUserKeycardImport?
|
|
|
|
qsTr("I prefer to use my PIN") :
|
|
|
|
qsTr("I prefer to use my password")
|
2022-05-23 09:03:57 +00:00
|
|
|
font.pixelSize: 15
|
2022-03-07 22:59:38 +00:00
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
hoverEnabled: true
|
|
|
|
onEntered: {
|
|
|
|
parent.font.underline = true
|
|
|
|
}
|
|
|
|
onExited: {
|
|
|
|
parent.font.underline = false
|
|
|
|
}
|
|
|
|
onClicked: {
|
2022-07-20 12:34:44 +00:00
|
|
|
root.startupStore.doSecondaryAction()
|
2022-03-07 22:59:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Loader {
|
|
|
|
id: dimBackground
|
|
|
|
anchors.fill: parent
|
|
|
|
active: false
|
|
|
|
sourceComponent: Rectangle {
|
|
|
|
color: Qt.rgba(0, 0, 0, 0.4)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|