reduce maskArea calls and dockGeometry changes

--fix also an issue of changing normal state
continuously during various animations that
need only length space
pull/1/head
Michail Vourlakos 8 years ago
parent f49ab516a4
commit b3391e9e34

@ -91,7 +91,7 @@ Item{
} }
function slotMustBeShown() { function slotMustBeShown() {
console.log("show..."); // console.log("show...");
slidingAnimationAutoHiddenIn.init(); slidingAnimationAutoHiddenIn.init();
} }
@ -100,7 +100,7 @@ Item{
} }
function slotMustBeHide() { function slotMustBeHide() {
console.log("hide...."); // console.log("hide....");
slidingAnimationAutoHiddenOut.init(); slidingAnimationAutoHiddenOut.init();
} }
@ -125,7 +125,7 @@ Item{
&& (!mainLayout.animatedLength) && (!mainLayout.animatedLength)
// debug maskArea criteria // debug maskArea criteria
// console.log(root.nowDockHoveredIndex + ", " + layoutsContainer.hoveredIndex + ", " //console.log(root.nowDockHoveredIndex + ", " + layoutsContainer.hoveredIndex + ", "
// + root.appletsAnimations+ ", " // + root.appletsAnimations+ ", "
// + root.animationsNeedBothAxis + ", " + root.animationsNeedLength + ", " + root.animationsNeedThickness +", " // + root.animationsNeedBothAxis + ", " + root.animationsNeedLength + ", " + root.animationsNeedThickness +", "
// + mainLayout.animatedLength); // + mainLayout.animatedLength);
@ -136,6 +136,7 @@ Item{
var space = root.panelEdgeSpacing + 10; var space = root.panelEdgeSpacing + 10;
if (normalState && plasmoid.immutable) { if (normalState && plasmoid.immutable) {
//console.log("entered normal state...");
//count panel length //count panel length
if(root.isHorizontal) { if(root.isHorizontal) {
tempLength = plasmoid.configuration.panelPosition === Latte.Dock.Double ? layoutsContainer.width + 0.5*space : mainLayout.width + space; tempLength = plasmoid.configuration.panelPosition === Latte.Dock.Double ? layoutsContainer.width + 0.5*space : mainLayout.width + space;
@ -194,7 +195,8 @@ Item{
tempLength = Screen.height; //screenGeometry.height; tempLength = Screen.height; //screenGeometry.height;
//grow only on length and not thickness //grow only on length and not thickness
if(mainLayout.animatedLength || !plasmoid.immutable) { if(mainLayout.animatedLength || !plasmoid.immutable
|| (root.animationsNeedLength>0 && root.animationsNeedBothAxis === 0)) {
tempThickness = thicknessNormalOriginal; tempThickness = thicknessNormalOriginal;
if (root.animationsNeedThickness > 0) { if (root.animationsNeedThickness > 0) {

@ -386,7 +386,7 @@ DragDrop.DropArea {
//// END OF Behaviors //// END OF Behaviors
//////////////START OF CONNECTIONS //////////////START OF CONNECTIONS
onAppletsAnimationsChanged: visibilityManager.updateMaskArea(); // onAppletsAnimationsChanged: visibilityManager.updateMaskArea();
onDockChanged: { onDockChanged: {
if (dock) { if (dock) {
@ -752,12 +752,12 @@ DragDrop.DropArea {
animatedLengthTimer.start(); animatedLengthTimer.start();
} }
if (!dock.visibility.containsMouse && (root.animationsNeedBothAxis === 0) /* if (!dock.visibility.containsMouse && (root.animationsNeedBothAxis === 0)
&& (root.animationsNeedLength===0) && (root.appletsAnimations === 0)) { && (root.animationsNeedLength===0) && (root.appletsAnimations === 0)) {
mainLayout.animatedLength = true; mainLayout.animatedLength = true;
} else { } else {
mainLayout.animatedLength = false; mainLayout.animatedLength = false;
} }*/
visibilityManager.updateMaskArea(); visibilityManager.updateMaskArea();
} }
@ -1271,7 +1271,7 @@ DragDrop.DropArea {
Timer { Timer {
id: animatedLengthTimer id: animatedLengthTimer
interval: 150 interval: 500
onTriggered: { onTriggered: {
// if (!magicWin.isHovered && (appletsAnimations === 0) // if (!magicWin.isHovered && (appletsAnimations === 0)
// && (root.animationsNeedLength === 0) && (root.animationsNeedBothAxis === 0)) { // && (root.animationsNeedLength === 0) && (root.animationsNeedBothAxis === 0)) {

@ -378,16 +378,14 @@ MouseArea{
function sendEndOfNeedBothAxisAnimation(){ function sendEndOfNeedBothAxisAnimation(){
if (mainItemContainer.isZoomed) { if (mainItemContainer.isZoomed) {
mainItemContainer.isZoomed = false; mainItemContainer.isZoomed = false;
if (panel.animationsNeedBothAxis > 0) { panel.setAnimationsNeedBothAxis(-1);
panel.setAnimationsNeedBothAxis(panel.animationsNeedBothAxis - 1);
}
} }
} }
onScaleChanged: { onScaleChanged: {
if ((scale > 1) && !mainItemContainer.isZoomed) { if ((scale > 1) && !mainItemContainer.isZoomed) {
mainItemContainer.isZoomed = true; mainItemContainer.isZoomed = true;
panel.setAnimationsNeedBothAxis(panel.animationsNeedBothAxis + 1); panel.setAnimationsNeedBothAxis(1);
} else if ((scale == 1) && mainItemContainer.isZoomed) { } else if ((scale == 1) && mainItemContainer.isZoomed) {
sendEndOfNeedBothAxisAnimation(); sendEndOfNeedBothAxisAnimation();
} }
@ -918,11 +916,19 @@ MouseArea{
} }
} }
mainItemContainer.inAnimation = false; mainItemContainer.inAnimation = false;
if (isWindow || isStartup) {
panel.setAnimationsNeedLength(-1);
}
} }
function init(){ function init(){
wrapper.tempScaleWidth = 0; wrapper.tempScaleWidth = 0;
wrapper.tempScaleHeight = 0; wrapper.tempScaleHeight = 0;
if (isWindow || isStartup) {
panel.setAnimationsNeedLength(1);
}
} }
function showWindow(){ function showWindow(){
@ -1070,6 +1076,9 @@ MouseArea{
PropertyAction { target: mainItemContainer; property: "inAnimation"; value: false } PropertyAction { target: mainItemContainer; property: "inAnimation"; value: false }
PropertyAction { target: mainItemContainer; property: "ListView.delayRemove"; value: false } PropertyAction { target: mainItemContainer; property: "ListView.delayRemove"; value: false }
PropertyAction { target: icList; property: "delayingRemoval"; value: false } PropertyAction { target: icList; property: "delayingRemoval"; value: false }
onStarted: panel.setAnimationsNeedLength(+1);
onStopped: panel.setAnimationsNeedLength(-1);
} }
}// main Item }// main Item

@ -474,8 +474,8 @@ Item{
panel.noTasksInAnimation--; panel.noTasksInAnimation--;
} }
if ( launchedAlready && panel.animationsNeedThickness>0 ) { if ( launchedAlready ) {
panel.setAnimationsNeedThickness( panel.animationsNeedThickness-1 ); panel.setAnimationsNeedThickness(-1);
} }
launchedAlready = false; launchedAlready = false;
@ -485,7 +485,7 @@ Item{
//console.log ("Nooo 1 : "+panel.noTasksInAnimation); //console.log ("Nooo 1 : "+panel.noTasksInAnimation);
if(!launchedAlready) { if(!launchedAlready) {
launchedAlready = true; launchedAlready = true;
panel.setAnimationsNeedThickness( panel.animationsNeedThickness+1 ); panel.setAnimationsNeedThickness(1);
panel.noTasksInAnimation++; panel.noTasksInAnimation++;
mainItemContainer.setBlockingAnimation(true); mainItemContainer.setBlockingAnimation(true);
} }
@ -582,9 +582,7 @@ Item{
function sendEndOfNeedThicknessAnimation(){ function sendEndOfNeedThicknessAnimation(){
if (needsThicknessSent) { if (needsThicknessSent) {
needsThicknessSent = false; needsThicknessSent = false;
if (panel.animationsNeedThickness > 0) { panel.setAnimationsNeedThickness(-1);
panel.setAnimationsNeedThickness( panel.animationsNeedThickness-1 );
}
} }
} }
@ -599,7 +597,7 @@ Item{
if (!needsThicknessSent) { if (!needsThicknessSent) {
needsThicknessSent = true; needsThicknessSent = true;
panel.setAnimationsNeedThickness( panel.animationsNeedThickness+1 ); panel.setAnimationsNeedThickness(1);
} }
// icList.hoveredIndex = -1; // icList.hoveredIndex = -1;

@ -163,28 +163,42 @@ Item {
onGroupingLauncherUrlBlacklistChanged: tasksModel.groupingLauncherUrlBlacklist = plasmoid.configuration.groupingLauncherUrlBlacklist; onGroupingLauncherUrlBlacklistChanged: tasksModel.groupingLauncherUrlBlacklist = plasmoid.configuration.groupingLauncherUrlBlacklist;
} }
function setAnimationsNeedBothAxis(value) { function setAnimationsNeedBothAxis(step) {
if (value === animationsNeedBothAxis) { if ((step === 0) || (plasmoid.configuration.durationTime ===0)) {
return; return;
} }
animationsNeedBothAxis = value; animationsNeedBothAxis = animationsNeedBothAxis + step;
if (animationsNeedBothAxis < 0) {
animationsNeedBothAxis = 0;
}
signalAnimationsNeedBothAxis(animationsNeedBothAxis); signalAnimationsNeedBothAxis(animationsNeedBothAxis);
} }
function setAnimationsNeedLength(value) { function setAnimationsNeedLength(step) {
if (value === animationsNeedLength) { if ((step === 0) || (plasmoid.configuration.durationTime ===0)) {
return; return;
} }
animationsNeedLength = value;
animationsNeedLength = animationsNeedLength + step;
if (animationsNeedLength < 0) {
animationsNeedLength = 0;
}
signalAnimationsNeedLength(animationsNeedLength); signalAnimationsNeedLength(animationsNeedLength);
} }
function setAnimationsNeedThickness(value) { function setAnimationsNeedThickness(step) {
if (value === animationsNeedThickness) { if ((step === 0) || (plasmoid.configuration.durationTime ===0)) {
return; return;
} }
animationsNeedThickness = value;
animationsNeedThickness = animationsNeedThickness + step;
if (animationsNeedThickness < 0) {
animationsNeedThickness = 0;
}
signalAnimationsNeedThickness(animationsNeedThickness); signalAnimationsNeedThickness(animationsNeedThickness);
} }

Loading…
Cancel
Save