chore(general/ui): old animated text renamed to status color animation and moved to statusq

- Old component name `AnimatedText` renamed to `StatusColorAnimation`
- Component moved from `ui/imports/shared/panels` to `ui/StatusQ/src/StatusQ/Controls` location
This commit is contained in:
Sale Djenic 2025-01-21 09:41:33 +01:00
parent 65cc5a7c55
commit ff9532f921
8 changed files with 71 additions and 39 deletions

View File

@ -0,0 +1,62 @@
import QtQuick 2.15
import StatusQ.Core.Theme 0.1
/*!
\qmltype StatusColorAnimation
\inherits SequentialAnimation
\inqmlmodule StatusQ.Controls
\since StatusQ.Controls 0.1
\brief Animates target property (that shold be a color property) from/to color to target component within set duration.
Example of how to use it:
\qml
StatusBaseText {
id: animatedText
onTextChanged: {
if (text === "") {
return
}
animate.restart()
}
StatusColorAnimation {
id: animate
target: animatedText
}
}
\endqml
For a list of components available see StatusQ.
*/
SequentialAnimation {
id: root
required property var target
property string targetProperty: "color"
property color fromColor: Theme.palette.directColor1
property color toColor: Theme.palette.getColor(fromColor, 0.1)
property int duration: 500 // in milliseconds
loops: 3
alwaysRunToEnd: true
ColorAnimation {
target: root.target
property: root.targetProperty
from: root.fromColor
to: root.toColor
duration: root.duration
}
ColorAnimation {
target: root.target
property: root.targetProperty
from: root.toColor
to: root.fromColor
duration: root.duration
}
}

View File

@ -14,6 +14,7 @@ StatusChatListCategoryItemButton 0.1 StatusChatListCategoryItemButton.qml
StatusCheckBox 0.1 StatusCheckBox.qml
StatusCircularProgressBar 0.1 StatusCircularProgressBar.qml
StatusClearButton 0.1 StatusClearButton.qml
StatusColorAnimation 0.1 StatusColorAnimation.qml
StatusColorRadioButton 0.1 StatusColorRadioButton.qml
StatusColorSelector 0.1 StatusColorSelector.qml
StatusColorSelectorGrid 0.1 StatusColorSelectorGrid.qml

View File

@ -105,6 +105,7 @@
<file>StatusQ/Controls/StatusCheckBox.qml</file>
<file>StatusQ/Controls/StatusCircularProgressBar.qml</file>
<file>StatusQ/Controls/StatusClearButton.qml</file>
<file>StatusQ/Controls/StatusColorAnimation.qml</file>
<file>StatusQ/Controls/StatusColorRadioButton.qml</file>
<file>StatusQ/Controls/StatusColorSelector.qml</file>
<file>StatusQ/Controls/StatusColorSelectorGrid.qml</file>

View File

@ -505,7 +505,7 @@ StatusDialog {
font.weight: Font.Medium
loading: root.swapAdaptor.swapProposalLoading
AnimatedText {
StatusColorAnimation {
id: animation
target: fees
}

View File

@ -1,31 +0,0 @@
import QtQuick 2.15
import StatusQ.Core.Theme 0.1
SequentialAnimation {
id: root
property var target: null
property string targetProperty: "color"
property color fromColor: Theme.palette.directColor1
property color toColor: Theme.palette.getColor(fromColor, 0.1)
property int duration: 500 // in milliseconds
loops: 3
ColorAnimation {
target: root.target
property: root.targetProperty
from: root.fromColor
to: root.toColor
duration: root.duration
}
ColorAnimation {
target: root.target
property: root.targetProperty
from: root.toColor
to: root.fromColor
duration: root.duration
}
}

View File

@ -18,4 +18,3 @@ Separator 1.0 Separator.qml
SequenceColumnLayout 1.0 SequenceColumnLayout.qml
StatusAssetSelector 1.0 StatusAssetSelector.qml
StyledText 1.0 StyledText.qml
AnimatedText 1.0 AnimatedText.qml

View File

@ -52,7 +52,7 @@ StatusDialogFooter {
estimatedTimeAnimation.restart()
}
AnimatedText {
StatusColorAnimation {
id: estimatedTimeAnimation
target: estimatedTime
}
@ -80,7 +80,7 @@ StatusDialogFooter {
feesAnimation.restart()
}
AnimatedText {
StatusColorAnimation {
id: feesAnimation
target: fees
}

View File

@ -118,7 +118,7 @@ SignTransactionModalBase {
maxFeesAnimation.restart()
}
AnimatedText {
StatusColorAnimation {
id: maxFeesAnimation
target: maxFees
targetProperty: "customColor"
@ -148,7 +148,7 @@ SignTransactionModalBase {
estimatedTimeAnimation.restart()
}
AnimatedText {
StatusColorAnimation {
id: estimatedTimeAnimation
target: estimatedTime
targetProperty: "customColor"
@ -224,7 +224,7 @@ SignTransactionModalBase {
fiatFeesAnimation.restart()
}
AnimatedText {
StatusColorAnimation {
id: fiatFeesAnimation
target: fiatFees
targetProperty: "customColor"
@ -250,7 +250,7 @@ SignTransactionModalBase {
cryptoFeesAnimation.restart()
}
AnimatedText {
StatusColorAnimation {
id: cryptoFeesAnimation
target: cryptoFees
fromColor: cryptoFees.customColor