on xenial help sign in
plop
757eb62Nick Dedekind
qml/Panel/New/IndicatorsBar.qml+34−17
@@ -83,15 +83,6 @@ Item {
83 }
83 }
84 }
84 }
85
85
86− contentX: {
87− var cX = row.width - flickable.width > 0 ? row.width - flickable.width : 0
88− if (cX !== 0) {
89− cX -= d.rowOffset;
90− }
91− return cX;
92− }
93− Behavior on contentX { enabled: !expanded; NumberAnimation { duration: 1000; easing: UbuntuAnimation.StandardEasing } }
94−
95 IndicatorsRow {
86 IndicatorsRow {
96 id: row
87 id: row
97 enabled: false
88 enabled: false
@@ -99,15 +90,10 @@ Item {
99 top: parent.top
90 top: parent.top
100 bottom: parent.bottom
91 bottom: parent.bottom
101 right: parent.right
92 right: parent.right
102− rightMargin: {
103− var rM = row.width - flickable.width < 0 ? row.width - flickable.width : 0;
104− if (rM !== 0) {
105− rM -= d.rowOffset;
106− }
107− return rM;
108− }
109 }
93 }
110 }
94 }
95+
96+ onContentXChanged: console.log("contentX: ", contentX)
111 }
97 }
112
98
113 states: [
99 states: [
@@ -118,10 +104,19 @@ Item {
118 target: d
104 target: d
119 rowOffset: 0
105 rowOffset: 0
120 }
106 }
107+ PropertyChanges {
108+ target: flickable
109+ contentX: row.width - flickable.width > 0 ? row.width - flickable.width : 0
110+ }
111+ PropertyChanges {
112+ target: row
113+ anchors.rightMargin: row.width - flickable.width < 0 ? row.width - flickable.width : 0
114+ }
121 },
115 },
122 State {
116 State {
123 name: "expanded"
117 name: "expanded"
124 when: expanded
118 when: expanded
119+
125 PropertyChanges {
120 PropertyChanges {
126 target: d
121 target: d
127 rowOffset: {
122 rowOffset: {
@@ -132,13 +127,35 @@ Item {
132 return rowOffset;
127 return rowOffset;
133 }
128 }
134 }
129 }
130+ PropertyChanges {
131+ target: flickable
132+ contentX: {
133+ var cX = row.width - flickable.width > 0 ? row.width - flickable.width : 0
134+ if (cX !== 0) {
135+ cX -= d.rowOffset;
136+ }
137+ return cX;
138+ }
139+ }
140+ PropertyChanges {
141+ target: row
142+ anchors.rightMargin: {
143+ var rM = row.width - flickable.width < 0 ? row.width - flickable.width : 0;
144+ if (rM !== 0) {
145+ rM -= d.rowOffset;
146+ }
147+ return rM;
148+ }
149+ }
135 }
150 }
136 ]
151 ]
137
152
138 transitions: [
153 transitions: [
139 Transition {
154 Transition {
140 to: "minimized"
155 to: "minimized"
156+ PropertyAction { target: d; properties: "rowOffset" }
157+ PropertyAnimation { target: flickable; properties: "contentX"; duration: 1000; easing: UbuntuAnimation.StandardEasing }
141− PropertyAnimation { target: d; properties: "rowOffset"; duration: 1000; easing: UbuntuAnimation.StandardEasing }
158+ PropertyAnimation { target: row; properties: "anchors.rightMargin"; duration: 1000; easing: UbuntuAnimation.StandardEasing }
142 }
159 }
143 ]
160 ]
144}
161}