1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-03-24 18:50:38 +03:00

improve dragging animations

This commit is contained in:
Michail Vourlakos 2017-07-29 19:58:16 +03:00
parent 54c2d2b17e
commit 6833406509
2 changed files with 35 additions and 5 deletions

View File

@ -465,10 +465,10 @@ MouseArea{
onHoveredIndexChanged: {
var distanceFromHovered = Math.abs(index - icList.hoveredIndex);
if( (distanceFromHovered > 1) && (hoveredIndex !== -1)){
/*if( (distanceFromHovered > 1) && (hoveredIndex !== -1)){
if(!isDragged)
wrapper.mScale = 1;
}
}*/
if (distanceFromHovered >= 1) {
hiddenSpacerLeft.nScale = 0;

View File

@ -619,9 +619,6 @@ Item{
State{
name: "isDragged"
when: ( (mainItemContainer.isDragged) && (!root.editMode) )
// PropertyChanges { target: clickedAnimation; running:false }
PropertyChanges { target: wrapper; mScale:1 + ((root.zoomFactor - 1) / 2)}
}
]
@ -634,6 +631,25 @@ Item{
property int speed: root.durationTime*units.longDuration
SequentialAnimation{
ScriptAction{
script: {
icList.directRender = false;
if(latteDock) {
latteDock.globalDirectRender=false;
}
mainItemContainer.inBlockingAnimation = true;
}
}
PropertyAnimation {
target: wrapper
property: "mScale"
to: 1 + ((root.zoomFactor - 1) / 2)
duration: isDraggedTransition.speed / 2
easing.type: Easing.OutQuad
}
ParallelAnimation{
PropertyAnimation {
target: draggedRectangle
@ -677,6 +693,15 @@ Item{
property int speed: root.durationTime*units.longDuration
SequentialAnimation{
ScriptAction{
script: {
icList.directRender = false;
if(latteDock) {
latteDock.globalDirectRender=false;
}
}
}
ParallelAnimation{
PropertyAnimation {
target: draggedRectangle
@ -711,6 +736,11 @@ Item{
easing.type: Easing.OutQuad
}
ScriptAction{
script: {
mainItemContainer.inBlockingAnimation = false;
}
}
}
onRunningChanged: {