on xenial help sign in
Use standard animations
74598dcNick Dedekind
Panel/IndicatorItem.qml+5
@@ -17,6 +17,7 @@
17import QtQuick 2.0
17import QtQuick 2.0
18import Ubuntu.Components 0.1
18import Ubuntu.Components 0.1
19import Unity.Indicators 0.1 as Indicators
19import Unity.Indicators 0.1 as Indicators
20+import "../Components"
20
21
21Item {
22Item {
22 id: indicatorItem
23 id: indicatorItem
@@ -27,6 +28,7 @@ Item {
27 property var indicatorProperties: undefined
28 property var indicatorProperties: undefined
28
29
29 opacity: dimmed ? 0.4 : 1
30 opacity: dimmed ? 0.4 : 1
31+ Behavior on opacity { StandardAnimation {} }
30
32
31 // only visible when non-empty
33 // only visible when non-empty
32 visible: loader.item != undefined && loader.status == Loader.Ready ? loader.item.enabled : false
34 visible: loader.item != undefined && loader.status == Loader.Ready ? loader.item.enabled : false
@@ -53,5 +55,8 @@ Item {
53 width: parent.width
55 width: parent.width
54 anchors.top: parent.bottom
56 anchors.top: parent.bottom
55 visible: highlighted
57 visible: highlighted
58+
59+ opacity: highlighted ? 1 : 0
60+ Behavior on opacity { StandardAnimation {} }
56 }
61 }
57}
62}
Panel/IndicatorRow.qml+5−16
@@ -16,6 +16,7 @@
16
16
17import QtQuick 2.0
17import QtQuick 2.0
18import Ubuntu.Components 0.1
18import Ubuntu.Components 0.1
19+import "../Components"
19
20
20Item {
21Item {
21 id: indicatorRow
22 id: indicatorRow
@@ -25,7 +26,7 @@ Item {
25 property alias row: row
26 property alias row: row
26 property QtObject indicatorsModel: null
27 property QtObject indicatorsModel: null
27
28
28− Behavior on y {NumberAnimation {duration: 300; easing.type: Easing.OutCubic} }
29+ Behavior on y { StandardAnimation {} }
29
30
30 width: units.gu(40)
31 width: units.gu(40)
31 height: units.gu(3)
32 height: units.gu(3)
@@ -82,21 +83,9 @@ Item {
82 }
83 }
83 }
84 }
84 Behavior on y {
85 Behavior on y {
85− NumberAnimation{
86+ StandardAnimation {
86− duration: {
87+ // flow away from current index
87− if (index == 0) {
88+ duration: (rowRepeater.count - Math.abs(indicatorRow.currentItemIndex - index)) * (500/rowRepeater.count)
88− return 250
89− } else if (index == 1) {
90− return 150
91− } else if (index == 2) {
92− return 550
93− } else if (index == 3) {
94− return 400
95− } else {
96− return 100 + Math.random() * 200
97− }
98− }
99− easing.type: Easing.OutCubic
100 }
89 }
101 }
90 }
102 }
91 }
Panel/Panel.qml+1−3
@@ -41,9 +41,7 @@ Item {
41 y: 0
41 y: 0
42 onYChanged: indicatorsMenu.y = y;
42 onYChanged: indicatorsMenu.y = y;
43
43
44− Behavior on y {
44+ Behavior on y { StandardAnimation {} }
45− NumberAnimation { duration: 200 }
46− }
47 }
45 }
48
46
49 PanelSeparatorLine {
47 PanelSeparatorLine {
Panel/SearchIndicator.qml+2−1
@@ -16,6 +16,7 @@
16
16
17import QtQuick 2.0
17import QtQuick 2.0
18import Ubuntu.Components 0.1
18import Ubuntu.Components 0.1
19+import "../Components"
19
20
20Item {
21Item {
21 id: search
22 id: search
@@ -40,7 +41,7 @@ Item {
40 width: parent.width
41 width: parent.width
41 height: parent.height
42 height: parent.height
42
43
43− Behavior on opacity {NumberAnimation {}}
44+ Behavior on opacity { StandardAnimation {} }
44 Behavior on y {NumberAnimation {duration: 300; easing.type: Easing.OutCubic}}
45 Behavior on y {NumberAnimation {duration: 300; easing.type: Easing.OutCubic}}
45
46
46 Image {
47 Image {