on xenial help sign in
fix content/effect movement calculation when switching row
04a625fMichael Zanetti
Dash/GenericScopeView.qml+11−7
@@ -346,27 +346,31 @@ ScopeView {
346
346
347 onCurrentIndexChanged: {
347 onCurrentIndexChanged: {
348 var row = Math.floor(currentIndex / categoryDelegate.columns);
348 var row = Math.floor(currentIndex / categoryDelegate.columns);
349+ if (categoryDelegate.collapsedRowCount <= row) {
350+ categoryView.expandedCategoryId = categoryId
351+ }
349 if (!init && model !== undefined) {
352 if (!init && model !== undefined) {
350 var item = model.get(currentIndex)
353 var item = model.get(currentIndex)
351 scopeView.scope.preview( item.uri, item.icon, item.category, 0, item.mimetype, item.title, item.comment, item.dndUri, item.metadata)
354 scopeView.scope.preview( item.uri, item.icon, item.category, 0, item.mimetype, item.title, item.comment, item.dndUri, item.metadata)
352 if (oldRow != -1) {
355 if (oldRow != -1) {
353 if (row < oldRow) {
356 if (row < oldRow) {
357+ var effectMove = 0;
354 if (categoryView.contentY - categoryDelegate.cellHeight < 0) {
358 if (categoryView.contentY - categoryDelegate.cellHeight < 0) {
355− effect.positionPx -= categoryDelegate.cellHeight - categoryView.contentY
359+ effectMove = categoryDelegate.cellHeight - categoryView.contentY;
360+ effect.positionPx -= effectMove;
356 }
361 }
357− categoryView.contentY = Math.max(0, categoryView.contentY - categoryDelegate.cellHeight)
362+ categoryView.contentY -= categoryDelegate.cellHeight - effectMove;
358 } else if (row > oldRow){
363 } else if (row > oldRow){
364+ var effectMove = 0;
359 if (categoryView.contentY + categoryDelegate.cellHeight > categoryView.contentHeight - categoryView.height) {
365 if (categoryView.contentY + categoryDelegate.cellHeight > categoryView.contentHeight - categoryView.height) {
360− effect.positionPx += categoryDelegate.cellHeight - (categoryView.contentY - (categoryView.contentHeight - categoryView.height))
366+ effectMove = (categoryView.contentY + categoryDelegate.cellHeight) - (categoryView.contentHeight - categoryView.height);
367+ effect.positionPx += effectMove;
361 }
368 }
362− categoryView.contentY = Math.min(categoryView.contentHeight - categoryView.height, categoryView.contentY + categoryDelegate.cellHeight)
369+ categoryView.contentY += categoryDelegate.cellHeight - effectMove
363 }
370 }
364 }
371 }
365 }
372 }
366 oldRow = row;
373 oldRow = row;
367− if (categoryDelegate.collapsedRowCount <= row) {
368− categoryView.expandedCategoryId = categoryId
369− }
370
374
371 if (open) {
375 if (open) {
372 categoryDelegate.highlightIndex = currentIndex
376 categoryDelegate.highlightIndex = currentIndex