on xenial help sign in
As per design-request an alert-state change should animate contentY-change triggered by positionViewAtIndex() method.
commitc93a6f716e03e7743273365db005e2f3439623a9 authorMirco Müller <mirco.mueller@ubuntu.com> dateTue 16 Jun 2015, 15:55 (11 years ago) parent530b169
1 file changed+20−1
qml/Launcher/LauncherPanel.qml+20−1
qml/Launcher/LauncherPanel.qml+20−1
@@ -124,6 +124,12 @@ Rectangle {
124124 // need to be smaller than this size to avoid breakage.
125125 property int extensionSize: 0
126126
127+ QtObject {
128+ id: priv
129+ property real moveToIndexYFrom
130+ property real moveToIndexYTo
131+ }
132+
127133 // Setting extensionSize after the list has been populated because it has
128134 // the potential to mess up with the intial positioning in combination
129135 // with snapping to the center of the list. This catches all the cases
@@ -137,6 +143,14 @@ Rectangle {
137143 flick(0, clickFlickSpeed)
138144 }
139145
146+ UbuntuNumberAnimation {
147+ id: moveToIndexAnimation
148+ target: launcherListView
149+ property: "contentY"
150+ from: priv.moveToIndexYFrom
151+ to: priv.moveToIndexYTo
152+ }
153+
140154 function peeking(peek) {
141155 if (peekingIndex === -1) {
142156 peekingIndex = peek
@@ -153,7 +167,12 @@ Rectangle {
153167 if (peekingIndex !== -1) {
154168 panel.visible = true
155169 launcherListViewItem.clip = false
156− positionViewAtIndex(peekingIndex, ListView.Center)
170+ if (!dragging) {
171+ priv.moveToIndexYFrom = contentY
172+ positionViewAtIndex(peekingIndex, ListView.Center)
173+ priv.moveToIndexYTo = contentY
174+ moveToIndexAnimation.start()
175+ }
157176 } else {
158177 launcherListViewItem.clip = true
159178 }