Skip to content

Commit 9709f8e

Browse files
committed
qml: consistent color animation
1 parent 67a220c commit 9709f8e

File tree

8 files changed

+48
-0
lines changed

8 files changed

+48
-0
lines changed

src/qml/components/PeersIndicator.qml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ RowLayout {
2828
SmoothedAnimation { to: 0; velocity: 2.2 }
2929
SmoothedAnimation { to: 1; velocity: 2.2 }
3030
}
31+
32+
Behavior on color {
33+
ColorAnimation { duration: 150 }
34+
}
3135
}
3236
}
3337
}

src/qml/components/Separator.qml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,8 @@ import "../controls"
99
Rectangle {
1010
height: 1
1111
color: Theme.color.neutral5
12+
13+
Behavior on color {
14+
ColorAnimation { duration: 150 }
15+
}
1216
}

src/qml/controls/CoreText.qml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,8 @@ Text {
1515
horizontalAlignment: Text.AlignHCenter
1616
verticalAlignment: Text.AlignVCenter
1717
wrapMode: wrap ? Text.WordWrap : Text.NoWrap
18+
19+
Behavior on color {
20+
ColorAnimation { duration: 150 }
21+
}
1822
}

src/qml/controls/Header.qml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ ColumnLayout {
5454
text: root.description
5555
horizontalAlignment: root.center ? Text.AlignHCenter : Text.AlignLeft
5656
wrapMode: wrap ? Text.WordWrap : Text.NoWrap
57+
58+
Behavior on color {
59+
ColorAnimation { duration: 150 }
60+
}
5761
}
5862
}
5963
Loader {
@@ -69,6 +73,10 @@ ColumnLayout {
6973
text: root.subtext
7074
horizontalAlignment: root.center ? Text.AlignHCenter : Text.AlignLeft
7175
wrapMode: wrap ? Text.WordWrap : Text.NoWrap
76+
77+
Behavior on color {
78+
ColorAnimation { duration: 150 }
79+
}
7280
}
7381
}
7482
}

src/qml/controls/NavButton.qml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ AbstractButton {
6666
icon.height: root.iconHeight
6767
icon.width: root.iconWidth
6868
background: root.iconBackground
69+
70+
Behavior on icon.color {
71+
ColorAnimation { duration: 150 }
72+
}
6973
}
7074
}
7175
Loader {

src/qml/controls/OptionButton.qml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ Button {
4747
background: Rectangle {
4848
color: Theme.color.neutral9
4949
radius: 3
50+
51+
Behavior on color {
52+
ColorAnimation { duration: 150 }
53+
}
5054
}
5155
font.styleName: "Regular"
5256
font.pixelSize: 13
@@ -56,6 +60,10 @@ Button {
5660
leftPadding: 7
5761
color: Theme.color.neutral0
5862
text: qsTr("Recommended")
63+
64+
Behavior on color {
65+
ColorAnimation { duration: 150 }
66+
}
5967
}
6068
}
6169
}
@@ -70,6 +78,10 @@ Button {
7078
icon.height: 24
7179
icon.width: 24
7280
background: null
81+
82+
Behavior on icon.color {
83+
ColorAnimation { duration: 150 }
84+
}
7385
}
7486
}
7587
}

src/qml/controls/OptionSwitch.qml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ Switch {
1212
background: Rectangle {
1313
radius: Math.floor(height / 2)
1414
color: root.checked ? Theme.color.orange : Theme.color.neutral4
15+
16+
Behavior on color {
17+
ColorAnimation { duration: 150 }
18+
}
1519
}
1620
indicator: Rectangle {
1721
property real _margin: Math.round((parent.height - height) / 2)
@@ -25,5 +29,9 @@ Switch {
2529
SmoothedAnimation {
2630
}
2731
}
32+
33+
Behavior on color {
34+
ColorAnimation { duration: 150 }
35+
}
2836
}
2937
}

src/qml/pages/main.qml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ ApplicationWindow {
1919
color: Theme.color.background
2020
visible: true
2121

22+
Behavior on color {
23+
ColorAnimation { duration: 150 }
24+
}
25+
2226
StackView {
2327
id: main
2428
initialItem: needOnboarding ? onboardingWizard : node

0 commit comments

Comments
 (0)