on xenial help sign in
move the openeffect position around instead of overscroll the listview
b5e6cf2Michael Zanetti
Dash/GenericScopeView.qml+15−3
@@ -264,6 +264,10 @@ ScopeView {
264 }
264 }
265 }
265 }
266 }
266 }
267+ Behavior on positionPx {
268+ enabled: previewListView.open
269+ UbuntuNumberAnimation {}
270+ }
267 }
271 }
268
272
269 Connections {
273 Connections {
@@ -328,9 +332,15 @@ ScopeView {
328 scopeView.scope.preview( item.uri, item.icon, item.category, 0, item.mimetype, item.title, item.comment, item.dndUri, item.metadata)
332 scopeView.scope.preview( item.uri, item.icon, item.category, 0, item.mimetype, item.title, item.comment, item.dndUri, item.metadata)
329 if (oldRow != -1) {
333 if (oldRow != -1) {
330 if (row < oldRow) {
334 if (row < oldRow) {
335+ if (categoryView.contentY - categoryDelegate.cellHeight < 0) {
331− categoryView.contentY -= categoryDelegate.cellHeight
336+ effect.positionPx -= categoryDelegate.cellHeight - categoryView.contentY
337+ }
338+ categoryView.contentY = Math.max(0, categoryView.contentY - categoryDelegate.cellHeight)
332 } else if (row > oldRow){
339 } else if (row > oldRow){
333− categoryView.contentY += categoryDelegate.cellHeight
340+ if (categoryView.contentY + categoryDelegate.cellHeight > categoryView.contentHeight - categoryView.height) {
341+ effect.positionPx += categoryDelegate.cellHeight - (categoryView.contentY - (categoryView.contentHeight - categoryView.height))
342+ }
343+ categoryView.contentY = Math.min(categoryView.contentHeight - categoryView.height, categoryView.contentY + categoryDelegate.cellHeight)
334 }
344 }
335 }
345 }
336 }
346 }
@@ -353,7 +363,9 @@ ScopeView {
353 categoryDelegate.highlightIndex = currentIndex;
363 categoryDelegate.highlightIndex = currentIndex;
354 } else {
364 } else {
355 // Cancel any pending preview requests or actions
365 // Cancel any pending preview requests or actions
366+ if (previewListView.currentItem.previewData !== undefined) {
356− previewListView.currentItem.previewData.cancelAction();
367+ previewListView.currentItem.previewData.cancelAction();
368+ }
357 scopeView.scope.cancelActivation();
369 scopeView.scope.cancelActivation();
358 model = undefined;
370 model = undefined;
359 categoryView.correctExpandedCategory();
371 categoryView.correctExpandedCategory();