update considering par.effect disabled

--reconsider/fixes applets axis blocking for parabolic
effect when unblock it also when applets are updating
their properties. This takes place only when
applets zoom factor === 1 (in normal mode) otherwise
the parabolic effect may broke
pull/6/head
Michail Vourlakos 6 years ago
parent 39f7f3bb0e
commit d7a6e76679

@ -294,6 +294,8 @@ Item{
return; return;
} }
var blockParabolicEffect = false;
if (isLattePlasmoid) { if (isLattePlasmoid) {
return; return;
} else if (appletItem.isInternalViewSplitter){ } else if (appletItem.isInternalViewSplitter){
@ -307,6 +309,7 @@ Item{
} }
else{ else{
if(applet && (applet.Layout.minimumHeight > root.iconSize) && root.isVertical && !canBeHovered && !communicator.overlayLatteIconIsActive){ if(applet && (applet.Layout.minimumHeight > root.iconSize) && root.isVertical && !canBeHovered && !communicator.overlayLatteIconIsActive){
blockParabolicEffect = true;
layoutHeight = applet.Layout.minimumHeight; layoutHeight = applet.Layout.minimumHeight;
} //it is used for plasmoids that need to scale only one axis... e.g. the Weather Plasmoid } //it is used for plasmoids that need to scale only one axis... e.g. the Weather Plasmoid
else if(applet else if(applet
@ -316,16 +319,15 @@ Item{
&& root.isVertical && root.isVertical
&& !disableScaleWidth && !disableScaleWidth
&& !communicator.overlayLatteIconIsActive) { && !communicator.overlayLatteIconIsActive) {
disableScaleHeight = true;
//this way improves performance, probably because during animation the preferred sizes update a lot //this way improves performance, probably because during animation the preferred sizes update a lot
if((applet.Layout.maximumHeight < root.iconSize)){ if((applet.Layout.maximumHeight < root.iconSize)){
layoutHeight = applet.Layout.maximumHeight; layoutHeight = applet.Layout.maximumHeight;
} else if (applet.Layout.minimumHeight > root.iconSize){ } else if (applet.Layout.minimumHeight > root.iconSize){
blockParabolicEffect = true;
layoutHeight = applet.Layout.minimumHeight; layoutHeight = applet.Layout.minimumHeight;
} else if ((applet.Layout.preferredHeight > root.iconSize) } else if ((applet.Layout.preferredHeight > root.iconSize)
|| (appletItem.originalAppletBehavior && applet.Layout.preferredHeight > 0 )){ || (appletItem.originalAppletBehavior && applet.Layout.preferredHeight > 0 )){
blockParabolicEffect = true;
layoutHeight = applet.Layout.preferredHeight; layoutHeight = applet.Layout.preferredHeight;
} else{ } else{
layoutHeight = root.iconSize; layoutHeight = root.iconSize;
@ -334,6 +336,14 @@ Item{
layoutHeight = root.iconSize; layoutHeight = root.iconSize;
} }
} }
if (wrapper.zoomScale === 1) {
if (blockParabolicEffect) {
disableScaleHeight = true;
} else {
disableScaleHeight = false;
}
}
} }
function updateLayoutWidth(){ function updateLayoutWidth(){
@ -344,6 +354,8 @@ Item{
return; return;
} }
var blockParabolicEffect = false;
if (isLattePlasmoid) { if (isLattePlasmoid) {
return; return;
} else if (appletItem.isInternalViewSplitter){ } else if (appletItem.isInternalViewSplitter){
@ -357,6 +369,7 @@ Item{
} }
else{ else{
if(applet && (applet.Layout.minimumWidth > root.iconSize) && root.isHorizontal && !canBeHovered && !communicator.overlayLatteIconIsActive){ if(applet && (applet.Layout.minimumWidth > root.iconSize) && root.isHorizontal && !canBeHovered && !communicator.overlayLatteIconIsActive){
blockParabolicEffect = true;
layoutWidth = applet.Layout.minimumWidth; layoutWidth = applet.Layout.minimumWidth;
} //it is used for plasmoids that need to scale only one axis... e.g. the Weather Plasmoid } //it is used for plasmoids that need to scale only one axis... e.g. the Weather Plasmoid
else if(applet else if(applet
@ -367,16 +380,16 @@ Item{
&& !disableScaleHeight && !disableScaleHeight
&& !communicator.overlayLatteIconIsActive){ && !communicator.overlayLatteIconIsActive){
disableScaleWidth = true;
//this way improves performance, probably because during animation the preferred sizes update a lot //this way improves performance, probably because during animation the preferred sizes update a lot
if((applet.Layout.maximumWidth < root.iconSize)){ if((applet.Layout.maximumWidth < root.iconSize)){
// return applet.Layout.maximumWidth; // return applet.Layout.maximumWidth;
layoutWidth = applet.Layout.maximumWidth; layoutWidth = applet.Layout.maximumWidth;
} else if (applet.Layout.minimumWidth > root.iconSize){ } else if (applet.Layout.minimumWidth > root.iconSize){
blockParabolicEffect = true;
layoutWidth = applet.Layout.minimumWidth; layoutWidth = applet.Layout.minimumWidth;
} else if ((applet.Layout.preferredWidth > root.iconSize) } else if ((applet.Layout.preferredWidth > root.iconSize)
|| (appletItem.originalAppletBehavior && applet.Layout.preferredWidth > 0 )){ || (appletItem.originalAppletBehavior && applet.Layout.preferredWidth > 0 )){
blockParabolicEffect = true;
layoutWidth = applet.Layout.preferredWidth; layoutWidth = applet.Layout.preferredWidth;
} else{ } else{
layoutWidth = root.iconSize; layoutWidth = root.iconSize;
@ -385,6 +398,14 @@ Item{
layoutWidth = root.iconSize; layoutWidth = root.iconSize;
} }
} }
if (wrapper.zoomScale === 1) {
if (blockParabolicEffect) {
disableScaleWidth = true;
} else {
disableScaleWidth = false;
}
}
} }
Item{ Item{

Loading…
Cancel
Save