improve fingerprint reader animation a bit
This commit is contained in:
parent
71d475e29a
commit
b779b7329e
@ -105,7 +105,7 @@ AWSClient::AWSClient(QObject *parent) : QObject(parent),
|
|||||||
m_userId = settings.value("userId").toString();
|
m_userId = settings.value("userId").toString();
|
||||||
m_password = settings.value("password").toString();
|
m_password = settings.value("password").toString();
|
||||||
m_accessToken = settings.value("accessToken").toByteArray();
|
m_accessToken = settings.value("accessToken").toByteArray();
|
||||||
// m_accessTokenExpiry = settings.value("accessTokenExpiry").toDateTime();
|
m_accessTokenExpiry = settings.value("accessTokenExpiry").toDateTime();
|
||||||
m_idToken = settings.value("idToken").toByteArray();
|
m_idToken = settings.value("idToken").toByteArray();
|
||||||
m_refreshToken = settings.value("refreshToken").toByteArray();
|
m_refreshToken = settings.value("refreshToken").toByteArray();
|
||||||
|
|
||||||
|
|||||||
@ -23,6 +23,8 @@ Item {
|
|||||||
property alias textureSource: segmentRenderer.source
|
property alias textureSource: segmentRenderer.source
|
||||||
property alias boxesSource: segmentBoundingBoxes.source
|
property alias boxesSource: segmentBoundingBoxes.source
|
||||||
|
|
||||||
|
property alias fillColor: segmentRenderer.fillColor
|
||||||
|
|
||||||
implicitWidth: segmentRenderer.implicitWidth
|
implicitWidth: segmentRenderer.implicitWidth
|
||||||
implicitHeight: segmentRenderer.implicitHeight
|
implicitHeight: segmentRenderer.implicitHeight
|
||||||
|
|
||||||
|
|||||||
@ -149,6 +149,7 @@ DevicePageBase {
|
|||||||
|
|
||||||
property string user: ""
|
property string user: ""
|
||||||
|
|
||||||
|
property bool done: false
|
||||||
property bool error: false
|
property bool error: false
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
@ -156,7 +157,10 @@ DevicePageBase {
|
|||||||
onExecuteActionReply: {
|
onExecuteActionReply: {
|
||||||
addUserPage.error = params["deviceError"] !== "DeviceErrorNoError"
|
addUserPage.error = params["deviceError"] !== "DeviceErrorNoError"
|
||||||
print("Execute action reply:", params["deviceError"]);
|
print("Execute action reply:", params["deviceError"]);
|
||||||
addUserSwipeView.currentIndex++
|
var masks =[]
|
||||||
|
masks.push({x: 0, y: 0, width: 1, height: 1});
|
||||||
|
fingerprintVisual.masks = masks
|
||||||
|
addUserPage.done = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,8 +169,7 @@ DevicePageBase {
|
|||||||
SwipeView {
|
SwipeView {
|
||||||
id: addUserSwipeView
|
id: addUserSwipeView
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: app.margins * 2
|
Layout.topMargin: app.margins
|
||||||
Layout.preferredHeight: 200
|
|
||||||
Layout.alignment: Qt.AlignTop
|
Layout.alignment: Qt.AlignTop
|
||||||
interactive: false
|
interactive: false
|
||||||
Item {
|
Item {
|
||||||
@ -238,7 +241,9 @@ DevicePageBase {
|
|||||||
anchors.margins: app.margins
|
anchors.margins: app.margins
|
||||||
spacing: app.margins * 2
|
spacing: app.margins * 2
|
||||||
Label {
|
Label {
|
||||||
text: qsTr("Please scan the fingerprint now")
|
text: !addUserPage.done ? qsTr("Please scan the fingerprint now")
|
||||||
|
: addUserPage.error ? qsTr("Uh oh")
|
||||||
|
: qsTr("All done!")
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
font.pixelSize: app.largeFont
|
font.pixelSize: app.largeFont
|
||||||
color: app.accentColor
|
color: app.accentColor
|
||||||
@ -246,52 +251,17 @@ DevicePageBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
Layout.preferredWidth: 200
|
Layout.preferredWidth: 100
|
||||||
Layout.preferredHeight: 200
|
Layout.preferredHeight: 100
|
||||||
Layout.alignment: Qt.AlignCenter
|
Layout.alignment: Qt.AlignCenter
|
||||||
|
|
||||||
FingerprintVisual {
|
FingerprintVisual {
|
||||||
id: fingerprintVisual
|
id: fingerprintVisual
|
||||||
scale: parent.height / implicitHeight
|
scale: parent.height / implicitHeight
|
||||||
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
Timer {
|
fillColor: addUserPage.error ? "red" : app.accentColor
|
||||||
interval: 500
|
|
||||||
property real position: 0
|
|
||||||
running: addUserSwipeView.currentIndex == 1
|
|
||||||
repeat: true
|
|
||||||
onTriggered: {
|
|
||||||
var masks = [];
|
|
||||||
masks.push({x: 0, y: 0, width: 1, height: position})
|
|
||||||
position += 0.1
|
|
||||||
if (position < 1.1) {
|
|
||||||
fingerprintVisual.masks = masks
|
|
||||||
} else {
|
|
||||||
position = 0
|
|
||||||
fingerprintVisual.masks = []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: addUserSwipeView.width
|
|
||||||
height: addUserSwipeView.height
|
|
||||||
|
|
||||||
ColumnLayout {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: app.margins
|
|
||||||
spacing: app.margins * 2
|
|
||||||
Label {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
font.pixelSize: app.largeFont
|
|
||||||
color: app.accentColor
|
|
||||||
text: addUserPage.error ? qsTr("Uh oh") :
|
|
||||||
qsTr("All done!")
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
}
|
}
|
||||||
Label {
|
Label {
|
||||||
text: addUserPage.error ? qsTr("Fingerprint could not be read.\nPlease try again.") :
|
text: addUserPage.error ? qsTr("Fingerprint could not be read.\nPlease try again.") :
|
||||||
@ -299,11 +269,13 @@ DevicePageBase {
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
visible: addUserPage.done
|
||||||
}
|
}
|
||||||
Button {
|
Button {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
text: qsTr("OK")
|
text: qsTr("OK")
|
||||||
onClicked: pageStack.pop()
|
onClicked: pageStack.pop()
|
||||||
|
visible: addUserPage.done
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user