on xenial help sign in
Opacity change for indicator item locking animation
commit3f11c574349ddcdcdfb0e144d2419c56844adc81 authorNick Dedekind <nicholas.dedekind@gmail.com> dateWed 24 Jul 2013, 12:40 (13 years ago) parent29bcfcf
1 file changed+25−19
Panel/IndicatorRow.qml+25−19
Panel/IndicatorRow.qml+25−19
@@ -54,30 +54,36 @@ Item {
5454 objectName: "rowRepeater"
5555 model: indicatorsModel ? indicatorsModel : undefined
5656
57− IndicatorItem {
58− id: indicatorItem
57+ Item {
58+ id: itemWrapper
59+ height: indicatorRow.height
60+ width: childrenRect.width
61+ property int ownIndex: index
5962
60− property int ownIndex: index
63+ IndicatorItem {
64+ id: indicatorItem
65+ height: parent.height
6166
62− widgetSource: model.widgetSource
67+ highlighted: indicatorRow.state != "initial" ? itemWrapper.ownIndex == indicatorRow.currentItemIndex : false
68+ dimmed: indicatorRow.state != "initial" ? itemWrapper.ownIndex != indicatorRow.currentItemIndex : false
6369
64− indicatorProperties : model.indicatorProperties
65− highlighted: indicatorRow.state != "initial" ? ownIndex == indicatorRow.currentItemIndex : false
66− dimmed: indicatorRow.state != "initial" ? ownIndex != indicatorRow.currentItemIndex : false
67− height: indicatorRow.height
68− y: {
69− if (!highlighted && (indicatorRow.state == "locked" || indicatorRow.state == "commit")) {
70− return -indicatorRow.height;
71− } else {
72− return 0;
73− }
74− }
75− Behavior on y {
76− StandardAnimation {
77− // flow away from current index
78− duration: (rowRepeater.count - Math.abs(indicatorRow.currentItemIndex - index)) * (500/rowRepeater.count)
70+ widgetSource: model.widgetSource
71+ indicatorProperties : model.indicatorProperties
72+ }
73+
74+ opacity: {
75+ if (!indicatorItem.highlighted && (indicatorRow.state == "locked" || indicatorRow.state == "commit")) {
76+ return 0.0;
77+ } else {
78+ return 1.0;
7979 }
8080 }
81+ Behavior on opacity {
82+ StandardAnimation {
83+ // flow away from current index
84+ duration: (rowRepeater.count - Math.abs(indicatorRow.currentItemIndex - index)) * (500/rowRepeater.count)
85+ }
86+ }
8187 }
8288 }
8389 }