summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/bar/components/ActiveWindow.qml2
-rw-r--r--widgets/StyledRect.qml6
-rw-r--r--widgets/StyledText.qml28
3 files changed, 32 insertions, 4 deletions
diff --git a/modules/bar/components/ActiveWindow.qml b/modules/bar/components/ActiveWindow.qml
index 1a2d5a5..b4dc14d 100644
--- a/modules/bar/components/ActiveWindow.qml
+++ b/modules/bar/components/ActiveWindow.qml
@@ -9,7 +9,7 @@ StyledRect {
readonly property color colour: Appearance.colours.pink
- animated: true
+ animate: true
clip: true
MaterialIcon {
diff --git a/widgets/StyledRect.qml b/widgets/StyledRect.qml
index f9d6ad1..07c1e77 100644
--- a/widgets/StyledRect.qml
+++ b/widgets/StyledRect.qml
@@ -4,7 +4,7 @@ import QtQuick
Rectangle {
id: root
- property bool animated: false
+ property bool animate: false
property bool vertical: false // Convenience property for propagation to children
color: "transparent"
@@ -20,7 +20,7 @@ Rectangle {
}
Behavior on implicitWidth {
- enabled: root.animated
+ enabled: root.animate
NumberAnimation {
duration: Appearance.anim.durations.normal
@@ -30,7 +30,7 @@ Rectangle {
}
Behavior on implicitHeight {
- enabled: root.animated
+ enabled: root.animate
NumberAnimation {
duration: Appearance.anim.durations.normal
diff --git a/widgets/StyledText.qml b/widgets/StyledText.qml
index ed5d791..6f281de 100644
--- a/widgets/StyledText.qml
+++ b/widgets/StyledText.qml
@@ -1,9 +1,14 @@
+pragma ComponentBehavior: Bound
+
import "root:/config"
import QtQuick
Text {
id: root
+ property bool animate: false
+ property string animateProp: "opacity"
+
renderType: Text.NativeRendering
color: Appearance.colours.text
font.family: Appearance.font.family.sans
@@ -15,4 +20,27 @@ Text {
easing.bezierCurve: Appearance.anim.curves.standard
}
}
+
+ Behavior on text {
+ enabled: root.animate
+
+ SequentialAnimation {
+ Anim {
+ to: 0
+ easing.bezierCurve: Appearance.anim.curves.standardAccel
+ }
+ PropertyAction {}
+ Anim {
+ to: 1
+ easing.bezierCurve: Appearance.anim.curves.standardDecel
+ }
+ }
+ }
+
+ component Anim: NumberAnimation {
+ target: root
+ property: root.animateProp
+ duration: Appearance.anim.durations.small
+ easing.type: Easing.BezierSpline
+ }
}