From 1f49f3fedd402e83dbfa8e95e8be725a62524596 Mon Sep 17 00:00:00 2001 From: Sale Djenic Date: Tue, 18 Oct 2022 10:31:23 +0200 Subject: [PATCH] chore(@desktop/keycard): keycard animations' details set as constants for easier maintaining --- .../Onboarding/views/KeycardInitView.qml | 48 +++---- .../Onboarding/views/KeycardPinView.qml | 12 +- .../Onboarding/views/KeycardStateView.qml | 60 ++++----- .../AppLayouts/Onboarding/views/LoginView.qml | 96 +++++++------- .../keycard/states/KeycardConfirmation.qml | 12 +- .../popups/keycard/states/KeycardInit.qml | 122 +++++++++--------- .../popups/keycard/states/KeycardPin.qml | 24 ++-- ui/imports/utils/Constants.qml | 57 ++++++++ 8 files changed, 245 insertions(+), 186 deletions(-) diff --git a/ui/app/AppLayouts/Onboarding/views/KeycardInitView.qml b/ui/app/AppLayouts/Onboarding/views/KeycardInitView.qml index 30213ce602..42c2e91da8 100644 --- a/ui/app/AppLayouts/Onboarding/views/KeycardInitView.qml +++ b/ui/app/AppLayouts/Onboarding/views/KeycardInitView.qml @@ -113,13 +113,13 @@ Item { } PropertyChanges { target: image - pattern: "keycard/card_insert/img-%1" + pattern: Constants.keycardAnimations.cardInsert.pattern source: "" - startImgIndexForTheFirstLoop: 0 - startImgIndexForOtherLoops: 0 - endImgIndex: 16 - duration: 1000 - loops: 1 + startImgIndexForTheFirstLoop: Constants.keycardAnimations.cardInsert.startImgIndexForTheFirstLoop + startImgIndexForOtherLoops: Constants.keycardAnimations.cardInsert.startImgIndexForOtherLoops + endImgIndex: Constants.keycardAnimations.cardInsert.endImgIndex + duration: Constants.keycardAnimations.cardInsert.duration + loops: Constants.keycardAnimations.cardInsert.loops } PropertyChanges { target: info @@ -141,13 +141,13 @@ Item { } PropertyChanges { target: image - pattern: "keycard/card_inserted/img-%1" + pattern: Constants.keycardAnimations.cardInserted.pattern source: "" - startImgIndexForTheFirstLoop: 0 - startImgIndexForOtherLoops: 0 - endImgIndex: 29 - duration: 1000 - loops: 1 + startImgIndexForTheFirstLoop: Constants.keycardAnimations.cardInserted.startImgIndexForTheFirstLoop + startImgIndexForOtherLoops: Constants.keycardAnimations.cardInserted.startImgIndexForOtherLoops + endImgIndex: Constants.keycardAnimations.cardInserted.endImgIndex + duration: Constants.keycardAnimations.cardInserted.duration + loops: Constants.keycardAnimations.cardInserted.loops } PropertyChanges { target: info @@ -166,13 +166,13 @@ Item { } PropertyChanges { target: image - pattern: "keycard/warning/img-%1" + pattern: Constants.keycardAnimations.warning.pattern source: "" - startImgIndexForTheFirstLoop: 0 - startImgIndexForOtherLoops: 0 - endImgIndex: 55 - duration: 3000 - loops: 1 + startImgIndexForTheFirstLoop: Constants.keycardAnimations.warning.startImgIndexForTheFirstLoop + startImgIndexForOtherLoops: Constants.keycardAnimations.warning.startImgIndexForOtherLoops + endImgIndex: Constants.keycardAnimations.warning.endImgIndex + duration: Constants.keycardAnimations.warning.duration + loops: Constants.keycardAnimations.warning.loops } PropertyChanges { target: info @@ -191,13 +191,13 @@ Item { } PropertyChanges { target: image - pattern: "keycard/success/img-%1" + pattern: Constants.keycardAnimations.success.pattern source: "" - startImgIndexForTheFirstLoop: 0 - startImgIndexForOtherLoops: 0 - endImgIndex: 29 - duration: 1300 - loops: 1 + startImgIndexForTheFirstLoop: Constants.keycardAnimations.success.startImgIndexForTheFirstLoop + startImgIndexForOtherLoops: Constants.keycardAnimations.success.startImgIndexForOtherLoops + endImgIndex: Constants.keycardAnimations.success.endImgIndex + duration: Constants.keycardAnimations.success.duration + loops: Constants.keycardAnimations.success.loops } PropertyChanges { target: info diff --git a/ui/app/AppLayouts/Onboarding/views/KeycardPinView.qml b/ui/app/AppLayouts/Onboarding/views/KeycardPinView.qml index 86f4775799..dda54eea86 100644 --- a/ui/app/AppLayouts/Onboarding/views/KeycardPinView.qml +++ b/ui/app/AppLayouts/Onboarding/views/KeycardPinView.qml @@ -167,13 +167,13 @@ Item { when: root.startupStore.currentStartupState.stateType === Constants.startupState.keycardPinSet PropertyChanges { target: image - pattern: "keycard/strong_success/img-%1" + pattern: Constants.keycardAnimations.strongSuccess.pattern source: "" - startImgIndexForTheFirstLoop: 0 - startImgIndexForOtherLoops: 0 - endImgIndex: 20 - duration: 1300 - loops: 1 + startImgIndexForTheFirstLoop: Constants.keycardAnimations.strongSuccess.startImgIndexForTheFirstLoop + startImgIndexForOtherLoops: Constants.keycardAnimations.strongSuccess.startImgIndexForOtherLoops + endImgIndex: Constants.keycardAnimations.strongSuccess.endImgIndex + duration: Constants.keycardAnimations.strongSuccess.duration + loops: Constants.keycardAnimations.strongSuccess.loops } PropertyChanges { target: title diff --git a/ui/app/AppLayouts/Onboarding/views/KeycardStateView.qml b/ui/app/AppLayouts/Onboarding/views/KeycardStateView.qml index 0b11b45b0c..25badf33d9 100644 --- a/ui/app/AppLayouts/Onboarding/views/KeycardStateView.qml +++ b/ui/app/AppLayouts/Onboarding/views/KeycardStateView.qml @@ -163,13 +163,13 @@ Item { when: root.startupStore.currentStartupState.stateType === Constants.startupState.keycardLocked PropertyChanges { target: image - pattern: "keycard/strong_error/img-%1" + pattern: Constants.keycardAnimations.strongError.pattern source: "" - startImgIndexForTheFirstLoop: 0 - startImgIndexForOtherLoops: 18 - endImgIndex: 29 - duration: 1300 - loops: -1 + startImgIndexForTheFirstLoop: Constants.keycardAnimations.strongError.startImgIndexForTheFirstLoop + startImgIndexForOtherLoops: Constants.keycardAnimations.strongError.startImgIndexForOtherLoops + endImgIndex: Constants.keycardAnimations.strongError.endImgIndex + duration: Constants.keycardAnimations.strongError.duration + loops: Constants.keycardAnimations.strongError.loops } PropertyChanges { target: title @@ -204,13 +204,13 @@ Item { when: root.startupStore.currentStartupState.stateType === Constants.startupState.keycardNotKeycard PropertyChanges { target: image - pattern: "keycard/strong_error/img-%1" + pattern: Constants.keycardAnimations.strongError.pattern source: "" - startImgIndexForTheFirstLoop: 0 - startImgIndexForOtherLoops: 18 - endImgIndex: 29 - duration: 1300 - loops: -1 + startImgIndexForTheFirstLoop: Constants.keycardAnimations.strongError.startImgIndexForTheFirstLoop + startImgIndexForOtherLoops: Constants.keycardAnimations.strongError.startImgIndexForOtherLoops + endImgIndex: Constants.keycardAnimations.strongError.endImgIndex + duration: Constants.keycardAnimations.strongError.duration + loops: Constants.keycardAnimations.strongError.loops } PropertyChanges { target: title @@ -244,13 +244,13 @@ Item { PropertyChanges { target: image - pattern: "keycard/strong_error/img-%1" + pattern: Constants.keycardAnimations.strongError.pattern source: "" - startImgIndexForTheFirstLoop: 0 - startImgIndexForOtherLoops: 18 - endImgIndex: 29 - duration: 1300 - loops: -1 + startImgIndexForTheFirstLoop: Constants.keycardAnimations.strongError.startImgIndexForTheFirstLoop + startImgIndexForOtherLoops: Constants.keycardAnimations.strongError.startImgIndexForOtherLoops + endImgIndex: Constants.keycardAnimations.strongError.endImgIndex + duration: Constants.keycardAnimations.strongError.duration + loops: Constants.keycardAnimations.strongError.loops } PropertyChanges { target: title @@ -292,13 +292,13 @@ Item { when: root.startupStore.currentStartupState.stateType === Constants.startupState.keycardRecover PropertyChanges { target: image - pattern: "keycard/strong_error/img-%1" + pattern: Constants.keycardAnimations.strongError.pattern source: "" - startImgIndexForTheFirstLoop: 0 - startImgIndexForOtherLoops: 18 - endImgIndex: 29 - duration: 1300 - loops: -1 + startImgIndexForTheFirstLoop: Constants.keycardAnimations.strongError.startImgIndexForTheFirstLoop + startImgIndexForOtherLoops: Constants.keycardAnimations.strongError.startImgIndexForOtherLoops + endImgIndex: Constants.keycardAnimations.strongError.endImgIndex + duration: Constants.keycardAnimations.strongError.duration + loops: Constants.keycardAnimations.strongError.loops } PropertyChanges { target: title @@ -331,13 +331,13 @@ Item { when: root.startupStore.currentStartupState.stateType === Constants.startupState.keycardWrongKeycard PropertyChanges { target: image - pattern: "keycard/strong_error/img-%1" + pattern: Constants.keycardAnimations.strongError.pattern source: "" - startImgIndexForTheFirstLoop: 0 - startImgIndexForOtherLoops: 18 - endImgIndex: 29 - duration: 1300 - loops: -1 + startImgIndexForTheFirstLoop: Constants.keycardAnimations.strongError.startImgIndexForTheFirstLoop + startImgIndexForOtherLoops: Constants.keycardAnimations.strongError.startImgIndexForOtherLoops + endImgIndex: Constants.keycardAnimations.strongError.endImgIndex + duration: Constants.keycardAnimations.strongError.duration + loops: Constants.keycardAnimations.strongError.loops } PropertyChanges { target: title diff --git a/ui/app/AppLayouts/Onboarding/views/LoginView.qml b/ui/app/AppLayouts/Onboarding/views/LoginView.qml index 95c6e50afc..b6bd5b05d4 100644 --- a/ui/app/AppLayouts/Onboarding/views/LoginView.qml +++ b/ui/app/AppLayouts/Onboarding/views/LoginView.qml @@ -648,13 +648,13 @@ Item { when: root.startupStore.currentStartupState.stateType === Constants.startupState.loginKeycardInsertKeycard PropertyChanges { target: image - pattern: "keycard/card_insert/img-%1" + pattern: Constants.keycardAnimations.cardInsert.pattern source: "" - startImgIndexForTheFirstLoop: 0 - startImgIndexForOtherLoops: 0 - endImgIndex: 16 - duration: 1000 - loops: 1 + startImgIndexForTheFirstLoop: Constants.keycardAnimations.cardInsert.startImgIndexForTheFirstLoop + startImgIndexForOtherLoops: Constants.keycardAnimations.cardInsert.startImgIndexForOtherLoops + endImgIndex: Constants.keycardAnimations.cardInsert.endImgIndex + duration: Constants.keycardAnimations.cardInsert.duration + loops: Constants.keycardAnimations.cardInsert.loops } PropertyChanges { target: title @@ -701,13 +701,13 @@ Item { when: root.startupStore.currentStartupState.stateType === Constants.startupState.loginKeycardInsertedKeycard PropertyChanges { target: image - pattern: "keycard/card_inserted/img-%1" + pattern: Constants.keycardAnimations.cardInserted.pattern source: "" - startImgIndexForTheFirstLoop: 0 - startImgIndexForOtherLoops: 0 - endImgIndex: 29 - duration: 1000 - loops: 1 + startImgIndexForTheFirstLoop: Constants.keycardAnimations.cardInserted.startImgIndexForTheFirstLoop + startImgIndexForOtherLoops: Constants.keycardAnimations.cardInserted.startImgIndexForOtherLoops + endImgIndex: Constants.keycardAnimations.cardInserted.endImgIndex + duration: Constants.keycardAnimations.cardInserted.duration + loops: Constants.keycardAnimations.cardInserted.loops } PropertyChanges { target: title @@ -752,13 +752,13 @@ Item { when: root.startupStore.currentStartupState.stateType === Constants.startupState.loginKeycardReadingKeycard PropertyChanges { target: image - pattern: "keycard/warning/img-%1" + pattern: Constants.keycardAnimations.warning.pattern source: "" - startImgIndexForTheFirstLoop: 0 - startImgIndexForOtherLoops: 0 - endImgIndex: 55 - duration: 3000 - loops: 1 + startImgIndexForTheFirstLoop: Constants.keycardAnimations.warning.startImgIndexForTheFirstLoop + startImgIndexForOtherLoops: Constants.keycardAnimations.warning.startImgIndexForOtherLoops + endImgIndex: Constants.keycardAnimations.warning.endImgIndex + duration: Constants.keycardAnimations.warning.duration + loops: Constants.keycardAnimations.warning.loops } PropertyChanges { target: title @@ -803,13 +803,13 @@ Item { when: root.startupStore.currentStartupState.stateType === Constants.startupState.loginKeycardRecognizedKeycard PropertyChanges { target: image - pattern: "keycard/success/img-%1" + pattern: Constants.keycardAnimations.success.pattern source: "" - startImgIndexForTheFirstLoop: 0 - startImgIndexForOtherLoops: 0 - endImgIndex: 29 - duration: 1300 - loops: 1 + startImgIndexForTheFirstLoop: Constants.keycardAnimations.success.startImgIndexForTheFirstLoop + startImgIndexForOtherLoops: Constants.keycardAnimations.success.startImgIndexForOtherLoops + endImgIndex: Constants.keycardAnimations.success.endImgIndex + duration: Constants.keycardAnimations.success.duration + loops: Constants.keycardAnimations.success.loops } PropertyChanges { target: title @@ -941,13 +941,13 @@ Item { when: root.startupStore.currentStartupState.stateType === Constants.startupState.loginKeycardPinVerified PropertyChanges { target: image - pattern: "keycard/strong_success/img-%1" + pattern: Constants.keycardAnimations.strongSuccess.pattern source: "" - startImgIndexForTheFirstLoop: 0 - startImgIndexForOtherLoops: 0 - endImgIndex: 20 - duration: 1300 - loops: 1 + startImgIndexForTheFirstLoop: Constants.keycardAnimations.strongSuccess.startImgIndexForTheFirstLoop + startImgIndexForOtherLoops: Constants.keycardAnimations.strongSuccess.startImgIndexForOtherLoops + endImgIndex: Constants.keycardAnimations.strongSuccess.endImgIndex + duration: Constants.keycardAnimations.strongSuccess.duration + loops: Constants.keycardAnimations.strongSuccess.loops } PropertyChanges { target: title @@ -988,13 +988,13 @@ Item { when: root.startupStore.currentStartupState.stateType === Constants.startupState.loginKeycardWrongKeycard PropertyChanges { target: image - pattern: "keycard/strong_error/img-%1" + pattern: Constants.keycardAnimations.strongError.pattern source: "" - startImgIndexForTheFirstLoop: 0 - startImgIndexForOtherLoops: 18 - endImgIndex: 29 - duration: 1300 - loops: -1 + startImgIndexForTheFirstLoop: Constants.keycardAnimations.strongError.startImgIndexForTheFirstLoop + startImgIndexForOtherLoops: Constants.keycardAnimations.strongError.startImgIndexForOtherLoops + endImgIndex: Constants.keycardAnimations.strongError.endImgIndex + duration: Constants.keycardAnimations.strongError.duration + loops: Constants.keycardAnimations.strongError.loops } PropertyChanges { target: title @@ -1094,13 +1094,13 @@ Item { root.startupStore.currentStartupState.stateType === Constants.startupState.loginKeycardMaxPairingSlotsReached PropertyChanges { target: image - pattern: "keycard/strong_error/img-%1" + pattern: Constants.keycardAnimations.strongError.pattern source: "" - startImgIndexForTheFirstLoop: 0 - startImgIndexForOtherLoops: 18 - endImgIndex: 29 - duration: 1300 - loops: -1 + startImgIndexForTheFirstLoop: Constants.keycardAnimations.strongError.startImgIndexForTheFirstLoop + startImgIndexForOtherLoops: Constants.keycardAnimations.strongError.startImgIndexForOtherLoops + endImgIndex: Constants.keycardAnimations.strongError.endImgIndex + duration: Constants.keycardAnimations.strongError.duration + loops: Constants.keycardAnimations.strongError.loops } PropertyChanges { target: title @@ -1191,13 +1191,13 @@ Item { when: root.startupStore.currentStartupState.stateType === Constants.startupState.loginNotKeycard PropertyChanges { target: image - pattern: "keycard/strong_error/img-%1" + pattern: Constants.keycardAnimations.strongError.pattern source: "" - startImgIndexForTheFirstLoop: 0 - startImgIndexForOtherLoops: 18 - endImgIndex: 29 - duration: 1300 - loops: -1 + startImgIndexForTheFirstLoop: Constants.keycardAnimations.strongError.startImgIndexForTheFirstLoop + startImgIndexForOtherLoops: Constants.keycardAnimations.strongError.startImgIndexForOtherLoops + endImgIndex: Constants.keycardAnimations.strongError.endImgIndex + duration: Constants.keycardAnimations.strongError.duration + loops: Constants.keycardAnimations.strongError.loops } PropertyChanges { target: title diff --git a/ui/imports/shared/popups/keycard/states/KeycardConfirmation.qml b/ui/imports/shared/popups/keycard/states/KeycardConfirmation.qml index e782984e0f..d20c1df71a 100644 --- a/ui/imports/shared/popups/keycard/states/KeycardConfirmation.qml +++ b/ui/imports/shared/popups/keycard/states/KeycardConfirmation.qml @@ -56,13 +56,13 @@ Item { Layout.alignment: Qt.AlignHCenter Layout.preferredHeight: Constants.keycard.shared.imageHeight Layout.preferredWidth: Constants.keycard.shared.imageWidth - pattern: "keycard/strong_error/img-%1" + pattern: Constants.keycardAnimations.strongError.pattern source: "" - startImgIndexForTheFirstLoop: 0 - startImgIndexForOtherLoops: 18 - endImgIndex: 29 - duration: 1300 - loops: -1 + startImgIndexForTheFirstLoop: Constants.keycardAnimations.strongError.startImgIndexForTheFirstLoop + startImgIndexForOtherLoops: Constants.keycardAnimations.strongError.startImgIndexForOtherLoops + endImgIndex: Constants.keycardAnimations.strongError.endImgIndex + duration: Constants.keycardAnimations.strongError.duration + loops: Constants.keycardAnimations.strongError.loops } StatusBaseText { diff --git a/ui/imports/shared/popups/keycard/states/KeycardInit.qml b/ui/imports/shared/popups/keycard/states/KeycardInit.qml index 3177a72274..23e45194e2 100644 --- a/ui/imports/shared/popups/keycard/states/KeycardInit.qml +++ b/ui/imports/shared/popups/keycard/states/KeycardInit.qml @@ -380,13 +380,13 @@ Item { } PropertyChanges { target: image - pattern: "keycard/card_insert/img-%1" + pattern: Constants.keycardAnimations.cardInsert.pattern source: "" - startImgIndexForTheFirstLoop: 0 - startImgIndexForOtherLoops: 0 - endImgIndex: 16 - duration: 1000 - loops: 1 + startImgIndexForTheFirstLoop: Constants.keycardAnimations.cardInsert.startImgIndexForTheFirstLoop + startImgIndexForOtherLoops: Constants.keycardAnimations.cardInsert.startImgIndexForOtherLoops + endImgIndex: Constants.keycardAnimations.cardInsert.endImgIndex + duration: Constants.keycardAnimations.cardInsert.duration + loops: Constants.keycardAnimations.cardInsert.loops } PropertyChanges { target: message @@ -409,13 +409,13 @@ Item { } PropertyChanges { target: image - pattern: "keycard/card_inserted/img-%1" + pattern: Constants.keycardAnimations.cardInserted.pattern source: "" - startImgIndexForTheFirstLoop: 0 - startImgIndexForOtherLoops: 0 - endImgIndex: 29 - duration: 1000 - loops: 1 + startImgIndexForTheFirstLoop: Constants.keycardAnimations.cardInserted.startImgIndexForTheFirstLoop + startImgIndexForOtherLoops: Constants.keycardAnimations.cardInserted.startImgIndexForOtherLoops + endImgIndex: Constants.keycardAnimations.cardInserted.endImgIndex + duration: Constants.keycardAnimations.cardInserted.duration + loops: Constants.keycardAnimations.cardInserted.loops } PropertyChanges { target: message @@ -455,13 +455,13 @@ Item { } PropertyChanges { target: image - pattern: "keycard/warning/img-%1" + pattern: Constants.keycardAnimations.warning.pattern source: "" - startImgIndexForTheFirstLoop: 0 - startImgIndexForOtherLoops: 0 - endImgIndex: 55 - duration: 3000 - loops: 1 + startImgIndexForTheFirstLoop: Constants.keycardAnimations.warning.startImgIndexForTheFirstLoop + startImgIndexForOtherLoops: Constants.keycardAnimations.warning.startImgIndexForOtherLoops + endImgIndex: Constants.keycardAnimations.warning.endImgIndex + duration: Constants.keycardAnimations.warning.duration + loops: Constants.keycardAnimations.warning.loops } PropertyChanges { target: message @@ -481,17 +481,19 @@ Item { PropertyChanges { target: image pattern: root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.authentication? - "" : "keycard/strong_error/img-%1" + "" : Constants.keycardAnimations.strongError.pattern source: root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.authentication? Style.png("keycard/plain-error") : "" - startImgIndexForTheFirstLoop: 0 + startImgIndexForTheFirstLoop: root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.authentication? + 0 : Constants.keycardAnimations.strongError.startImgIndexForTheFirstLoop startImgIndexForOtherLoops: root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.authentication? - 0 : 18 + 0 : Constants.keycardAnimations.strongError.startImgIndexForOtherLoops endImgIndex: root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.authentication? - 0 : 29 + 0 : Constants.keycardAnimations.strongError.endImgIndex duration: root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.authentication? - 0 : 1300 - loops: -1 + 0 : Constants.keycardAnimations.strongError.duration + loops: root.sharedKeycardModule.currentState.flowType === Constants.keycardSharedFlow.authentication? + -1 : Constants.keycardAnimations.strongError.loops } PropertyChanges { target: message @@ -512,13 +514,13 @@ Item { } PropertyChanges { target: image - pattern: "keycard/strong_error/img-%1" + pattern: Constants.keycardAnimations.strongError.pattern source: "" - startImgIndexForTheFirstLoop: 0 - startImgIndexForOtherLoops: 18 - endImgIndex: 29 - duration: 1300 - loops: -1 + startImgIndexForTheFirstLoop: Constants.keycardAnimations.strongError.startImgIndexForTheFirstLoop + startImgIndexForOtherLoops: Constants.keycardAnimations.strongError.startImgIndexForOtherLoops + endImgIndex: Constants.keycardAnimations.strongError.endImgIndex + duration: Constants.keycardAnimations.strongError.duration + loops: Constants.keycardAnimations.strongError.loops } PropertyChanges { target: message @@ -643,13 +645,13 @@ Item { } PropertyChanges { target: image - pattern: "keycard/strong_error/img-%1" + pattern: Constants.keycardAnimations.strongError.pattern source: "" - startImgIndexForTheFirstLoop: 0 - startImgIndexForOtherLoops: 18 - endImgIndex: 29 - duration: 1300 - loops: -1 + startImgIndexForTheFirstLoop: Constants.keycardAnimations.strongError.startImgIndexForTheFirstLoop + startImgIndexForOtherLoops: Constants.keycardAnimations.strongError.startImgIndexForOtherLoops + endImgIndex: Constants.keycardAnimations.strongError.endImgIndex + duration: Constants.keycardAnimations.strongError.duration + loops: Constants.keycardAnimations.strongError.loops } PropertyChanges { target: message @@ -684,13 +686,13 @@ Item { } PropertyChanges { target: image - pattern: "keycard/success/img-%1" + pattern: Constants.keycardAnimations.success.pattern source: "" - startImgIndexForTheFirstLoop: 0 - startImgIndexForOtherLoops: 0 - endImgIndex: 29 - duration: 1300 - loops: 1 + startImgIndexForTheFirstLoop: Constants.keycardAnimations.success.startImgIndexForTheFirstLoop + startImgIndexForOtherLoops: Constants.keycardAnimations.success.startImgIndexForOtherLoops + endImgIndex: Constants.keycardAnimations.success.endImgIndex + duration: Constants.keycardAnimations.success.duration + loops: Constants.keycardAnimations.success.loops } PropertyChanges { target: message @@ -709,13 +711,13 @@ Item { } PropertyChanges { target: image - pattern: "keycard/success/img-%1" + pattern: Constants.keycardAnimations.success.pattern source: "" - startImgIndexForTheFirstLoop: 0 - startImgIndexForOtherLoops: 0 - endImgIndex: 29 - duration: 1300 - loops: 1 + startImgIndexForTheFirstLoop: Constants.keycardAnimations.success.startImgIndexForTheFirstLoop + startImgIndexForOtherLoops: Constants.keycardAnimations.success.startImgIndexForOtherLoops + endImgIndex: Constants.keycardAnimations.success.endImgIndex + duration: Constants.keycardAnimations.success.duration + loops: Constants.keycardAnimations.success.loops } PropertyChanges { target: message @@ -757,13 +759,13 @@ Item { } PropertyChanges { target: image - pattern: "keycard/strong_success/img-%1" + pattern: Constants.keycardAnimations.strongSuccess.pattern source: "" - startImgIndexForTheFirstLoop: 0 - startImgIndexForOtherLoops: 0 - endImgIndex: 20 - duration: 1300 - loops: 1 + startImgIndexForTheFirstLoop: Constants.keycardAnimations.strongSuccess.startImgIndexForTheFirstLoop + startImgIndexForOtherLoops: Constants.keycardAnimations.strongSuccess.startImgIndexForOtherLoops + endImgIndex: Constants.keycardAnimations.strongSuccess.endImgIndex + duration: Constants.keycardAnimations.strongSuccess.duration + loops: Constants.keycardAnimations.strongSuccess.loops } PropertyChanges { target: message @@ -807,13 +809,13 @@ Item { } PropertyChanges { target: image - pattern: "keycard/strong_error/img-%1" + pattern: Constants.keycardAnimations.strongError.pattern source: "" - startImgIndexForTheFirstLoop: 0 - startImgIndexForOtherLoops: 18 - endImgIndex: 29 - duration: 1300 - loops: 1 + startImgIndexForTheFirstLoop: Constants.keycardAnimations.strongError.startImgIndexForTheFirstLoop + startImgIndexForOtherLoops: Constants.keycardAnimations.strongError.startImgIndexForOtherLoops + endImgIndex: Constants.keycardAnimations.strongError.endImgIndex + duration: Constants.keycardAnimations.strongError.duration + loops: Constants.keycardAnimations.strongError.loops } PropertyChanges { target: message diff --git a/ui/imports/shared/popups/keycard/states/KeycardPin.qml b/ui/imports/shared/popups/keycard/states/KeycardPin.qml index 519dd31b45..186ac430f8 100644 --- a/ui/imports/shared/popups/keycard/states/KeycardPin.qml +++ b/ui/imports/shared/popups/keycard/states/KeycardPin.qml @@ -411,13 +411,13 @@ Item { root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.changingKeycardPinSuccess PropertyChanges { target: image - pattern: "keycard/strong_success/img-%1" + pattern: Constants.keycardAnimations.strongSuccess.pattern source: "" - startImgIndexForTheFirstLoop: 0 - startImgIndexForOtherLoops: 0 - endImgIndex: 20 - duration: 1300 - loops: 1 + startImgIndexForTheFirstLoop: Constants.keycardAnimations.strongSuccess.startImgIndexForTheFirstLoop + startImgIndexForOtherLoops: Constants.keycardAnimations.strongSuccess.startImgIndexForOtherLoops + endImgIndex: Constants.keycardAnimations.strongSuccess.endImgIndex + duration: Constants.keycardAnimations.strongSuccess.duration + loops: Constants.keycardAnimations.strongSuccess.loops } PropertyChanges { target: title @@ -454,13 +454,13 @@ Item { when: root.sharedKeycardModule.currentState.stateType === Constants.keycardSharedState.changingKeycardPinFailure PropertyChanges { target: image - pattern: "keycard/strong_error/img-%1" + pattern: Constants.keycardAnimations.strongError.pattern source: "" - startImgIndexForTheFirstLoop: 0 - startImgIndexForOtherLoops: 18 - endImgIndex: 29 - duration: 1300 - loops: 1 + startImgIndexForTheFirstLoop: Constants.keycardAnimations.strongError.startImgIndexForTheFirstLoop + startImgIndexForOtherLoops: Constants.keycardAnimations.strongError.startImgIndexForOtherLoops + endImgIndex: Constants.keycardAnimations.strongError.endImgIndex + duration: Constants.keycardAnimations.strongError.duration + loops: Constants.keycardAnimations.strongError.loops } PropertyChanges { target: title diff --git a/ui/imports/utils/Constants.qml b/ui/imports/utils/Constants.qml index 277d276a04..a204a58b1b 100644 --- a/ui/imports/utils/Constants.qml +++ b/ui/imports/utils/Constants.qml @@ -162,6 +162,63 @@ QtObject { readonly property string changingKeycardPukFailure: "ChangingKeycardPukFailure" } + readonly property QtObject keycardAnimations: QtObject { + + readonly property QtObject cardInsert: QtObject { + readonly property string pattern: "keycard/card_insert/img-%1" + readonly property int startImgIndexForTheFirstLoop: 0 + readonly property int startImgIndexForOtherLoops: 0 + readonly property int endImgIndex: 16 + readonly property int duration: 1000 + readonly property int loops: 1 + } + + readonly property QtObject cardInserted: QtObject { + readonly property string pattern: "keycard/card_inserted/img-%1" + readonly property int startImgIndexForTheFirstLoop: 0 + readonly property int startImgIndexForOtherLoops: 0 + readonly property int endImgIndex: 29 + readonly property int duration: 1000 + readonly property int loops: 1 + } + + readonly property QtObject warning: QtObject { + readonly property string pattern: "keycard/warning/img-%1" + readonly property int startImgIndexForTheFirstLoop: 0 + readonly property int startImgIndexForOtherLoops: 0 + readonly property int endImgIndex: 55 + readonly property int duration: 3000 + readonly property int loops: 1 + } + + readonly property QtObject strongError: QtObject { + readonly property string pattern: "keycard/strong_error/img-%1" + readonly property int startImgIndexForTheFirstLoop: 0 + readonly property int startImgIndexForOtherLoops: 18 + readonly property int endImgIndex: 29 + readonly property int duration: 1300 + readonly property int loops: -1 + } + + readonly property QtObject success: QtObject { + readonly property string pattern: "keycard/success/img-%1" + readonly property int startImgIndexForTheFirstLoop: 0 + readonly property int startImgIndexForOtherLoops: 0 + readonly property int endImgIndex: 29 + readonly property int duration: 1300 + readonly property int loops: 1 + } + + readonly property QtObject strongSuccess: QtObject { + readonly property string pattern: "keycard/strong_success/img-%1" + readonly property int startImgIndexForTheFirstLoop: 0 + readonly property int startImgIndexForOtherLoops: 0 + readonly property int endImgIndex: 20 + readonly property int duration: 1300 + readonly property int loops: 1 + } + } + readonly property QtObject keychain: QtObject { readonly property QtObject errorType: QtObject { readonly property string authentication: "authentication"