1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-28 19:21:50 +03:00

plasmoid:fix window removal bouncing case

This commit is contained in:
Michail Vourlakos 2020-10-24 16:12:25 +03:00
parent 7aa4bff184
commit 50d1e20758

View File

@ -63,7 +63,7 @@ SequentialAnimation {
//trying to fix the ListView nasty behavior
//during the removal the anchoring for ListView children changes a lot
var previousTask = icList.childAtIndex(0/*(taskItem.lastValidIndex-1*/);
var previousTask = icList.childAtIndex(taskItem.lastValidIndex-1);
if (previousTask !== undefined && !previousTask.isStartup && !previousTask.inBouncingAnimation){
//! When removing a task and there are surrounding separators then the hidden spacers
@ -71,6 +71,8 @@ SequentialAnimation {
//! the removal animation a small margin must applied
var spacer = taskItem.headItemIsSeparator ? -(2+taskItem.metrics.totals.lengthEdge) : ( taskItem.headItemIsSeparator ? (2+taskItem.metrics.totals.lengthEdge)/2 : 0);
if (!taskItem.inBouncingAnimation) {
//! real slide-out case
var taskInListPos = mapToItem(icList, 0, 0);
taskItem.parent = icList;
@ -93,6 +95,16 @@ SequentialAnimation {
taskItem.anchors.bottom = icList.bottom;
}
}
} else {
// bouncing case
if (root.vertical) {
taskItem.anchors.top = previousTask.bottom;
taskItem.anchors.topMargin = spacer;
} else {
taskItem.anchors.left = previousTask.right;
taskItem.anchors.leftMargin = spacer;
}
}
}
//console.log("1." + taskItem.launcherUrl + " - " + tasksModel.launcherInCurrentActivity(taskItem.launcherUrl) + "__" +