on xenial help sign in
Use standard animations
commit74598dcfe0ad8a5a57e98fb8b57285148cfd14a1 authorNick Dedekind <nicholas.dedekind@gmail.com> dateWed 17 Jul 2013, 15:59 (13 years ago) parentfa24e91
4 files changed+13−20
Panel/IndicatorItem.qml+5 Panel/IndicatorRow.qml+5−16 Panel/Panel.qml+1−3 Panel/SearchIndicator.qml+2−1
Panel/IndicatorItem.qml+5
@@ -17,6 +17,7 @@
1717import QtQuick 2.0
1818import Ubuntu.Components 0.1
1919import Unity.Indicators 0.1 as Indicators
20+import "../Components"
2021
2122Item {
2223 id: indicatorItem
@@ -27,6 +28,7 @@ Item {
2728 property var indicatorProperties: undefined
2829
2930 opacity: dimmed ? 0.4 : 1
31+ Behavior on opacity { StandardAnimation {} }
3032
3133 // only visible when non-empty
3234 visible: loader.item != undefined && loader.status == Loader.Ready ? loader.item.enabled : false
@@ -53,5 +55,8 @@ Item {
5355 width: parent.width
5456 anchors.top: parent.bottom
5557 visible: highlighted
58+
59+ opacity: highlighted ? 1 : 0
60+ Behavior on opacity { StandardAnimation {} }
5661 }
5762}
Panel/IndicatorRow.qml+5−16
@@ -16,6 +16,7 @@
1616
1717import QtQuick 2.0
1818import Ubuntu.Components 0.1
19+import "../Components"
1920
2021Item {
2122 id: indicatorRow
@@ -25,7 +26,7 @@ Item {
2526 property alias row: row
2627 property QtObject indicatorsModel: null
2728
28− Behavior on y {NumberAnimation {duration: 300; easing.type: Easing.OutCubic} }
29+ Behavior on y { StandardAnimation {} }
2930
3031 width: units.gu(40)
3132 height: units.gu(3)
@@ -82,21 +83,9 @@ Item {
8283 }
8384 }
8485 Behavior on y {
85− NumberAnimation{
86− duration: {
87− if (index == 0) {
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
86+ StandardAnimation {
87+ // flow away from current index
88+ duration: (rowRepeater.count - Math.abs(indicatorRow.currentItemIndex - index)) * (500/rowRepeater.count)
10089 }
10190 }
10291 }
Panel/Panel.qml+1−3
@@ -41,9 +41,7 @@ Item {
4141 y: 0
4242 onYChanged: indicatorsMenu.y = y;
4343
44− Behavior on y {
45− NumberAnimation { duration: 200 }
46− }
44+ Behavior on y { StandardAnimation {} }
4745 }
4846
4947 PanelSeparatorLine {
Panel/SearchIndicator.qml+2−1
@@ -16,6 +16,7 @@
1616
1717import QtQuick 2.0
1818import Ubuntu.Components 0.1
19+import "../Components"
1920
2021Item {
2122 id: search
@@ -40,7 +41,7 @@ Item {
4041 width: parent.width
4142 height: parent.height
4243
43− Behavior on opacity {NumberAnimation {}}
44+ Behavior on opacity { StandardAnimation {} }
4445 Behavior on y {NumberAnimation {duration: 300; easing.type: Easing.OutCubic}}
4546
4647 Image {