mirror of
https://github.com/KDE/latte-dock.git
synced 2025-02-04 13:47:19 +03:00
improve mechanism for animations counting
This commit is contained in:
parent
39b8dfdd3e
commit
7cd1ae4ba7
@ -359,13 +359,13 @@ Item {
|
||||
if ((zoomScale > 1) && !container.isZoomed) {
|
||||
container.isZoomed = true;
|
||||
if (!root.editMode && !animationWasSent) {
|
||||
root.appletsAnimations++;
|
||||
root.slotAppletsAnimations(1);
|
||||
animationWasSent = true;
|
||||
}
|
||||
} else if ((zoomScale == 1) && container.isZoomed) {
|
||||
container.isZoomed = false;
|
||||
if (!root.editMode && animationWasSent) {
|
||||
root.appletsAnimations--;
|
||||
root.slotAppletsAnimations(-1);
|
||||
animationWasSent = false;
|
||||
}
|
||||
}
|
||||
|
@ -94,8 +94,7 @@ Image{
|
||||
|
||||
if(!animationSent) {
|
||||
animationSent = true;
|
||||
var anim = root.animationsNeedLength+1;
|
||||
root.slotAnimationsNeedLength(anim);
|
||||
root.slotAnimationsNeedLength(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -153,8 +152,7 @@ Image{
|
||||
script:{
|
||||
editVisual.editAnimationEnded = false;
|
||||
if (editVisual.animationSent) {
|
||||
var anim = root.animationsNeedLength-1;
|
||||
root.slotAnimationsNeedLength(anim);
|
||||
root.slotAnimationsNeedLength(-1);
|
||||
editVisual.animationSent = false;
|
||||
}
|
||||
}
|
||||
|
@ -106,10 +106,10 @@ Item{
|
||||
&& (!mainLayout.animatedLength)
|
||||
|
||||
// debug maskArea criteria
|
||||
//console.log(root.nowDockHoveredIndex + ", " + layoutsContainer.hoveredIndex + ", "
|
||||
// + root.appletsAnimations+ ", "
|
||||
// + root.animationsNeedBothAxis + ", " + root.animationsNeedLength + ", " + root.animationsNeedThickness +", "
|
||||
// + mainLayout.animatedLength);
|
||||
console.log(root.nowDockHoveredIndex + ", " + layoutsContainer.hoveredIndex + ", "
|
||||
+ root.appletsAnimations+ ", "
|
||||
+ root.animationsNeedBothAxis + ", " + root.animationsNeedLength + ", " + root.animationsNeedThickness +", "
|
||||
+ mainLayout.animatedLength);
|
||||
|
||||
var tempLength = root.isHorizontal ? width : height;
|
||||
var tempThickness = root.isHorizontal ? height : width;
|
||||
|
@ -388,7 +388,7 @@ DragDrop.DropArea {
|
||||
|
||||
//////////////START OF CONNECTIONS
|
||||
//this is used from zoomed applets in that container
|
||||
onAppletsAnimationsChanged: visibilityManager.updateMaskArea();
|
||||
//onAppletsAnimationsChanged: visibilityManager.updateMaskArea();
|
||||
|
||||
onEditModeChanged: {
|
||||
if (editMode) {
|
||||
@ -804,32 +804,42 @@ DragDrop.DropArea {
|
||||
return false;
|
||||
}
|
||||
|
||||
function slotAnimationsNeedBothAxis(value) {
|
||||
if (animationsNeedBothAxis === value) {
|
||||
function slotAnimationsNeedBothAxis(step) {
|
||||
if (step === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
animationsNeedBothAxis = Math.max(value, 0);
|
||||
animationsNeedBothAxis = Math.max(animationsNeedBothAxis + step, 0);
|
||||
|
||||
visibilityManager.updateMaskArea();
|
||||
}
|
||||
|
||||
function slotAnimationsNeedLength(value) {
|
||||
if (animationsNeedLength === value) {
|
||||
function slotAnimationsNeedLength(step) {
|
||||
if (step === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
animationsNeedLength = Math.max(value, 0);
|
||||
animationsNeedLength = Math.max(animationsNeedLength + step, 0);
|
||||
|
||||
visibilityManager.updateMaskArea();
|
||||
}
|
||||
|
||||
function slotAnimationsNeedThickness(value) {
|
||||
if (animationsNeedThickness === value) {
|
||||
function slotAnimationsNeedThickness(step) {
|
||||
if (step === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
animationsNeedThickness = Math.max(value, 0);
|
||||
animationsNeedThickness = Math.max(animationsNeedThickness + step, 0);
|
||||
|
||||
visibilityManager.updateMaskArea();
|
||||
}
|
||||
|
||||
function slotAppletsAnimations(step) {
|
||||
if (step === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
appletsAnimations = Math.max(appletsAnimations + step, 0);
|
||||
|
||||
visibilityManager.updateMaskArea();
|
||||
}
|
||||
|
@ -378,14 +378,14 @@ MouseArea{
|
||||
function sendEndOfNeedBothAxisAnimation(){
|
||||
if (mainItemContainer.isZoomed) {
|
||||
mainItemContainer.isZoomed = false;
|
||||
panel.setAnimationsNeedBothAxis(-1);
|
||||
panel.signalAnimationsNeedBothAxis(-1);
|
||||
}
|
||||
}
|
||||
|
||||
onScaleChanged: {
|
||||
if ((scale > 1) && !mainItemContainer.isZoomed) {
|
||||
mainItemContainer.isZoomed = true;
|
||||
panel.setAnimationsNeedBothAxis(1);
|
||||
panel.signalAnimationsNeedBothAxis(1);
|
||||
} else if ((scale == 1) && mainItemContainer.isZoomed) {
|
||||
sendEndOfNeedBothAxisAnimation();
|
||||
}
|
||||
@ -918,7 +918,7 @@ MouseArea{
|
||||
mainItemContainer.inAnimation = false;
|
||||
|
||||
if (isWindow || isStartup) {
|
||||
panel.setAnimationsNeedLength(-1);
|
||||
panel.signalAnimationsNeedLength(-1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -927,7 +927,7 @@ MouseArea{
|
||||
wrapper.tempScaleHeight = 0;
|
||||
|
||||
if (isWindow || isStartup) {
|
||||
panel.setAnimationsNeedLength(1);
|
||||
panel.signalAnimationsNeedLength(1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1042,6 +1042,7 @@ MouseArea{
|
||||
///Item's Removal Animation
|
||||
|
||||
ListView.onRemove: SequentialAnimation {
|
||||
ScriptAction{script:{panel.signalAnimationsNeedLength(1)}}
|
||||
PropertyAction { target: mainItemContainer; property: "ListView.delayRemove"; value: true }
|
||||
PropertyAction { target: mainItemContainer; property: "inAnimation"; value: true }
|
||||
PropertyAction { target: icList; property: "delayingRemoval"; value: true }
|
||||
@ -1076,9 +1077,7 @@ MouseArea{
|
||||
PropertyAction { target: mainItemContainer; property: "inAnimation"; value: false }
|
||||
PropertyAction { target: mainItemContainer; property: "ListView.delayRemove"; value: false }
|
||||
PropertyAction { target: icList; property: "delayingRemoval"; value: false }
|
||||
|
||||
onStarted: panel.setAnimationsNeedLength(+1);
|
||||
onStopped: panel.setAnimationsNeedLength(-1);
|
||||
ScriptAction{script:{panel.signalAnimationsNeedLength(-1)}}
|
||||
}
|
||||
|
||||
}// main Item
|
||||
|
@ -475,7 +475,7 @@ Item{
|
||||
}
|
||||
|
||||
if ( launchedAlready ) {
|
||||
panel.setAnimationsNeedThickness(-1);
|
||||
panel.signalAnimationsNeedThickness(-1);
|
||||
}
|
||||
|
||||
launchedAlready = false;
|
||||
@ -485,7 +485,7 @@ Item{
|
||||
//console.log ("Nooo 1 : "+panel.noTasksInAnimation);
|
||||
if(!launchedAlready) {
|
||||
launchedAlready = true;
|
||||
panel.setAnimationsNeedThickness(1);
|
||||
panel.signalAnimationsNeedThickness(1);
|
||||
panel.noTasksInAnimation++;
|
||||
mainItemContainer.setBlockingAnimation(true);
|
||||
}
|
||||
@ -582,7 +582,7 @@ Item{
|
||||
function sendEndOfNeedThicknessAnimation(){
|
||||
if (needsThicknessSent) {
|
||||
needsThicknessSent = false;
|
||||
panel.setAnimationsNeedThickness(-1);
|
||||
panel.signalAnimationsNeedThickness(-1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -597,7 +597,7 @@ Item{
|
||||
|
||||
if (!needsThicknessSent) {
|
||||
needsThicknessSent = true;
|
||||
panel.setAnimationsNeedThickness(1);
|
||||
panel.signalAnimationsNeedThickness(1);
|
||||
}
|
||||
|
||||
// icList.hoveredIndex = -1;
|
||||
|
@ -66,9 +66,6 @@ Item {
|
||||
property bool vertical: ((panel.position === PlasmaCore.Types.LeftPositioned) ||
|
||||
(panel.position === PlasmaCore.Types.RightPositioned)) ? true : false
|
||||
|
||||
property int animationsNeedBothAxis:0 //animations need space in both axes, e.g zooming a task
|
||||
property int animationsNeedLength: 0 // animations need length, e.g. adding a task
|
||||
property int animationsNeedThickness: 0 // animations need thickness, e.g. bouncing animation
|
||||
property int clearWidth
|
||||
property int clearHeight
|
||||
|
||||
@ -164,45 +161,6 @@ Item {
|
||||
onGroupingLauncherUrlBlacklistChanged: tasksModel.groupingLauncherUrlBlacklist = plasmoid.configuration.groupingLauncherUrlBlacklist;
|
||||
}
|
||||
|
||||
function setAnimationsNeedBothAxis(step) {
|
||||
if ((step === 0) || (plasmoid.configuration.durationTime ===0)) {
|
||||
return;
|
||||
}
|
||||
|
||||
animationsNeedBothAxis = animationsNeedBothAxis + step;
|
||||
if (animationsNeedBothAxis < 0) {
|
||||
animationsNeedBothAxis = 0;
|
||||
}
|
||||
|
||||
signalAnimationsNeedBothAxis(animationsNeedBothAxis);
|
||||
}
|
||||
|
||||
function setAnimationsNeedLength(step) {
|
||||
if ((step === 0) || (plasmoid.configuration.durationTime ===0)) {
|
||||
return;
|
||||
}
|
||||
|
||||
animationsNeedLength = animationsNeedLength + step;
|
||||
if (animationsNeedLength < 0) {
|
||||
animationsNeedLength = 0;
|
||||
}
|
||||
|
||||
signalAnimationsNeedLength(animationsNeedLength);
|
||||
}
|
||||
|
||||
function setAnimationsNeedThickness(step) {
|
||||
if ((step === 0) || (plasmoid.configuration.durationTime ===0)) {
|
||||
return;
|
||||
}
|
||||
|
||||
animationsNeedThickness = animationsNeedThickness + step;
|
||||
if (animationsNeedThickness < 0) {
|
||||
animationsNeedThickness = 0;
|
||||
}
|
||||
|
||||
signalAnimationsNeedThickness(animationsNeedThickness);
|
||||
}
|
||||
|
||||
/////
|
||||
PlasmaCore.ColorScope{
|
||||
id: colorScopePalette
|
||||
|
Loading…
x
Reference in New Issue
Block a user