rename Ability.Container to Metrics

--major change but improves readability a lot
pull/15/head
Michail Vourlakos 5 years ago
parent 2ed8b86913
commit 97e7c428b7

@ -907,6 +907,7 @@ void GenericLayout::addView(Plasma::Containment *containment, bool forceOnPrimar
latteView->setLayout(this);
//! Qt 5.9 creates a crash for this in wayland, that is why the check is used
//! but on the other hand we need this for copy to work correctly and show
//! the copied dock under X11

@ -22,7 +22,7 @@ var layout;
var layoutS;
var layoutE;
var root;
var container;
var metrics;
var plasmoid;
var lastSpacer;
@ -450,7 +450,7 @@ function insertAtLayoutCoordinates(tLayout, item, x, y) {
if (!child) {
// check if dragging takes place after the end of the layout
var neededSpace = 1.5 * (container.iconSize + root.lengthMargin);
var neededSpace = 1.5 * (metrics.iconSize + root.lengthMargin);
if ( (((root.isVertical && (y - neededSpace) <= tLayout.height) && y>=0)
||(root.isHorizontal && (x - neededSpace) <= tLayout.width) && x>=0)
&& tLayout.children.length>0 ){

@ -412,7 +412,7 @@ Window{
}
Text{
text: container.iconSize
text: metrics.iconSize
}
Text{
@ -428,7 +428,7 @@ Window{
}
Text{
text: container.proportionIconSize
text: metrics.proportionIconSize
}
Text{

@ -227,9 +227,9 @@ Item{
property int panelSize: automaticPanelSize
property int automaticPanelSize: {
if (root.behaveAsPlasmaPanel) {
return container.iconSize + root.thickMargins;// + 2;
return metrics.iconSize + root.thickMargins;// + 2;
} else {
var icons = container.iconSize + root.thickMargins;// + 2;
var icons = metrics.iconSize + root.thickMargins;// + 2;
var panelt = root.themePanelThickness;// + 2;
root.realPanelThickness = icons + root.localScreenEdgeMargin;

@ -40,7 +40,7 @@ Item{
property bool inForceHiding: false //is used when the docks are forced in hiding e.g. when changing layouts
property bool normalState : false // this is being set from updateMaskArea
property bool previousNormalState : false // this is only for debugging purposes
property bool panelIsBiggerFromIconSize: root.useThemePanel && (root.themePanelThickness >= (container.iconSize + root.thickMargin))
property bool panelIsBiggerFromIconSize: root.useThemePanel && (root.themePanelThickness >= (metrics.iconSize + root.thickMargin))
property bool maskIsFloating: !root.behaveAsPlasmaPanel
&& !root.editMode
@ -72,25 +72,25 @@ Item{
}
property int thicknessAutoHidden: LatteCore.WindowSystem.compositingActive ? 2 : 1
property int thicknessMid: root.screenEdgeMargin + (1 + (0.65 * (root.maxZoomFactor-1)))*(container.iconSize+root.thickMargins+extraThickMask) //needed in some animations
property int thicknessNormal: root.screenEdgeMargin + Math.max(container.iconSize + root.thickMargins + extraThickMask + 1, root.realPanelSize + root.panelShadow)
property int thicknessMid: root.screenEdgeMargin + (1 + (0.65 * (root.maxZoomFactor-1)))*(metrics.iconSize+root.thickMargins+extraThickMask) //needed in some animations
property int thicknessNormal: root.screenEdgeMargin + Math.max(metrics.iconSize + root.thickMargins + extraThickMask + 1, root.realPanelSize + root.panelShadow)
property int thicknessZoom: root.screenEdgeMargin + ((container.iconSize+root.thickMargins+extraThickMask) * root.maxZoomFactor) + 2
property int thicknessZoom: root.screenEdgeMargin + ((metrics.iconSize+root.thickMargins+extraThickMask) * root.maxZoomFactor) + 2
//it is used to keep thickness solid e.g. when iconSize changes from auto functions
property int thicknessMidOriginal: root.screenEdgeMargin + Math.max(thicknessNormalOriginal,extraThickMask + (1 + (0.65 * (root.maxZoomFactor-1)))*(container.maxIconSize+root.maxThickMargin)) //needed in some animations
property int thicknessNormalOriginal: root.screenEdgeMargin + container.maxIconSize + (root.maxThickMargin * 2) //this way we always have the same thickness published at all states
property int thicknessMidOriginal: root.screenEdgeMargin + Math.max(thicknessNormalOriginal,extraThickMask + (1 + (0.65 * (root.maxZoomFactor-1)))*(metrics.maxIconSize+root.maxThickMargin)) //needed in some animations
property int thicknessNormalOriginal: root.screenEdgeMargin + metrics.maxIconSize + (root.maxThickMargin * 2) //this way we always have the same thickness published at all states
/*property int thicknessNormalOriginal: !root.behaveAsPlasmaPanel || root.editMode ?
thicknessNormalOriginalValue : root.realPanelSize + root.panelShadow*/
property int thicknessNormalOriginalValue: root.screenEdgeMargin + container.maxIconSize + (root.maxThickMargin * 2) + extraThickMask + 1
property int thicknessZoomOriginal:root.screenEdgeMargin + Math.max( ((container.maxIconSize+(root.maxThickMargin * 2)) * root.maxZoomFactor) + extraThickMask + 2,
property int thicknessNormalOriginalValue: root.screenEdgeMargin + metrics.maxIconSize + (root.maxThickMargin * 2) + extraThickMask + 1
property int thicknessZoomOriginal:root.screenEdgeMargin + Math.max( ((metrics.maxIconSize+(root.maxThickMargin * 2)) * root.maxZoomFactor) + extraThickMask + 2,
root.realPanelSize + root.panelShadow,
(LatteCore.WindowSystem.compositingActive ? thicknessEditMode + root.editShadow : thicknessEditMode))
//! is used from Panel in edit mode in order to provide correct masking
property int thicknessEditMode: thicknessNormalOriginalValue + editModeVisual.settingsThickness
//! when Latte behaves as Plasma panel
property int thicknessAsPanel: container.iconSize + root.thickMargins
property int thicknessAsPanel: metrics.iconSize + root.thickMargins
//! is used to increase the mask thickness
readonly property int marginBetweenContentsAndRuler: root.editMode ? 10 : 0
@ -128,7 +128,7 @@ Item{
value: root.behaveAsPlasmaPanel && !root.editMode ? thicknessAsPanel : thicknessZoomOriginal
}
property bool validIconSize: (container.iconSize===container.maxIconSize || container.iconSize === autosize.iconSize)
property bool validIconSize: (metrics.iconSize===metrics.maxIconSize || metrics.iconSize === autosize.iconSize)
property bool inPublishingState: validIconSize && !inSlidingIn && !inSlidingOut && !inTempHiding && !inForceHiding
Binding{
@ -737,7 +737,7 @@ Item{
}
}
var validIconSize = (container.iconSize===container.maxIconSize || container.iconSize === autosize.iconSize);
var validIconSize = (metrics.iconSize===metrics.maxIconSize || metrics.iconSize === autosize.iconSize);
//console.log("reached updating geometry ::: "+dock.maskArea);
@ -750,7 +750,7 @@ Item{
//the shadows size must be removed from the maskArea
//before updating the localDockGeometry
if (!latteView.behaveAsPlasmaPanel || root.editMode) {
var cleanThickness = container.iconSize + root.thickMargins;
var cleanThickness = metrics.iconSize + root.thickMargins;
var edgeMargin = root.screenEdgeMargin;
if (plasmoid.location === PlasmaCore.Types.TopEdge) {

@ -26,8 +26,8 @@ import org.kde.latte.private.app 0.1 as LatteApp
import org.kde.latte.abilities.containers 0.1 as ContainerAbility
ContainerAbility.Animations {
property Item container: null
property Item settings: null
property Item metrics: null
property QtObject settings: null
//! Public Properties
active: plasmoid.configuration.animationsEnabled && LatteCore.WindowSystem.compositingActive
@ -59,9 +59,9 @@ ContainerAbility.Animations {
if (!settings || settings.sensitivity === LatteApp.Settings.HighMouseSensitivity) {
return 1;
} else if (settings.sensitivity === LatteApp.Settings.MediumMouseSensitivity) {
return Math.max(3, container.iconSize / 18);
return Math.max(3, metrics.iconSize / 18);
} else if (settings.sensitivity === LatteApp.Settings.LowMouseSensitivity) {
return Math.max(5, container.iconSize / 10);
return Math.max(5, metrics.iconSize / 10);
}
}
}

@ -34,7 +34,7 @@ Item {
&& latteView && latteView.visibility.mode !== LatteCore.Types.SideBar
property int iconSize: -1 //it is not set, this is the default
readonly property bool inCalculatedIconSize: ((container.iconSize === sizer.iconSize) || (container.iconSize === container.maxIconSize))
readonly property bool inCalculatedIconSize: ((metrics.iconSize === sizer.iconSize) || (metrics.iconSize === metrics.maxIconSize))
readonly property bool inAutoSizeAnimation: !inCalculatedIconSize
readonly property int automaticStep: 8
@ -47,12 +47,10 @@ Item {
property variant history: []
//! required elements
property Item container
property Item metrics
property Item layouts
property Item visibility
onInAutoSizeAnimationChanged: {
if (inAutoSizeAnimation) {
animations.needBothAxis.addEvent(sizer);
@ -76,10 +74,10 @@ Item {
}
Connections {
target: container
target: metrics
onProportionIconSizeChanged: {
if (container.proportionIconSize!==-1) {
if (metrics.proportionIconSize!==-1) {
sizer.updateIconSize();
}
}
@ -88,13 +86,13 @@ Item {
Connections {
target: latteView
onWidthChanged:{
if (root.isHorizontal && container.proportionIconSize!==-1) {
if (root.isHorizontal && metrics.proportionIconSize!==-1) {
sizer.updateIconSize();
}
}
onHeightChanged:{
if (root.isVertical && container.proportionIconSize!==-1) {
if (root.isVertical && metrics.proportionIconSize!==-1) {
sizer.updateIconSize();
}
}
@ -142,8 +140,8 @@ Item {
if ( !doubleCallAutomaticUpdateIconSize.running && !visibility.inTempHiding
&& ((visibility.normalState || root.editMode)
&& (sizer.isActive || (!sizer.isActive && container.iconSize!==container.maxIconSize)))
&& (container.iconSize===container.maxIconSize || container.iconSize === sizer.iconSize) ) {
&& (sizer.isActive || (!sizer.isActive && metrics.iconSize!==metrics.maxIconSize)))
&& (metrics.iconSize===metrics.maxIconSize || metrics.iconSize === sizer.iconSize) ) {
//!doubler timer
if (!doubleCallAutomaticUpdateIconSize.secondTimeCallApplied) {
@ -166,7 +164,7 @@ Item {
layouts.startLayout.width+layouts.mainLayout.width+layouts.endLayout.width : layouts.mainLayout.width
}
var itemLength = container.iconSize + lengthMargins;
var itemLength = metrics.iconSize + lengthMargins;
var toShrinkLimit = maxLength - (root.zoomFactor * itemLength);
//! to grow limit must be a little less than the shrink one in order to be more robust and
@ -179,11 +177,11 @@ Item {
var newIconSizeFound = false;
if (layoutLength > toShrinkLimit) { //must shrink
// console.log("step3");
var nextIconSize = container.maxIconSize;
var nextIconSize = metrics.maxIconSize;
do {
nextIconSize = nextIconSize - automaticStep;
var factor = nextIconSize / container.iconSize;
var factor = nextIconSize / metrics.iconSize;
var nextLength = factor * layoutLength;
} while ( (nextLength>toShrinkLimit) && (nextIconSize !== 16));
@ -197,7 +195,7 @@ Item {
addPrediction(intLength, intNextLength);
// console.log("Step 3 - found:"+iconSize);
} else if ((layoutLength<toGrowLimit
&& (container.iconSize === iconSize)) ) { //must grow probably
&& (metrics.iconSize === iconSize)) ) { //must grow probably
// console.log("step4");
var nextIconSize2 = iconSize;
var foundGoodSize = -1;
@ -210,13 +208,13 @@ Item {
if (nextLength2 < toGrowLimit) {
foundGoodSize = nextIconSize2;
}
} while ( (nextLength2<toGrowLimit) && (nextIconSize2 !== container.maxIconSize ));
} while ( (nextLength2<toGrowLimit) && (nextIconSize2 !== metrics.maxIconSize ));
var intLength2 = Math.round(layoutLength);
var intNextLength2 = Math.round(nextLength2);
if (foundGoodSize > 0 && !producesEndlessLoop(intLength2, intNextLength2)) {
if (foundGoodSize === container.maxIconSize) {
if (foundGoodSize === metrics.maxIconSize) {
iconSize = -1;
} else {
iconSize = foundGoodSize;

@ -22,8 +22,8 @@ import org.kde.plasma.plasmoid 2.0
import org.kde.latte.abilities.containers 0.1 as ContainerAbility
ContainerAbility.Container {
id: privateContainer
ContainerAbility.Metrics {
id: mets
property Item animations: null
property Item autosize: null
@ -55,7 +55,7 @@ ContainerAbility.Container {
onRunningChanged: {
if (!running) {
privateContainer.iconSizeAnimationEnded();
mets.iconSizeAnimationEnded();
}
}
}

@ -162,14 +162,14 @@ Item {
property int previousIndex: -1
property int sizeForFill: -1 //it is used in calculations for fillWidth,fillHeight applets
property int spacersMaxSize: Math.max(0,Math.ceil(0.55 * container.iconSize) - root.lengthMargins)
property int spacersMaxSize: Math.max(0,Math.ceil(0.55 * metrics.iconSize) - root.lengthMargins)
property int status: applet ? applet.status : -1
//! local margins
readonly property bool parabolicEffectMarginsEnabled: root.zoomFactor>1 && !originalAppletBehavior
property int lengthAppletIntMargin: root.lengthAppletIntMarginFactor === -1 || parabolicEffectMarginsEnabled ?
root.lengthIntMargin : root.lengthAppletIntMarginFactor * container.iconSize
root.lengthIntMargin : root.lengthAppletIntMarginFactor * metrics.iconSize
property int lengthAppletFullMargin: lengthAppletIntMargin + root.lengthExtMargin
property int lengthAppletFullMargins: 2 * lengthAppletFullMargin
@ -225,7 +225,7 @@ Item {
property Item animations: null
property Item appletsRecords: null
property Item container: null
property Item metrics: null
property bool containsMouse: appletMouseArea.containsMouse /*|| appletMouseAreaBottom.containsMouse*/
property bool pressed: viewSignalsConnector.pressed || clickedAnimation.running
@ -401,8 +401,8 @@ Item {
return;
}
var maxSize = appletItem.container.iconSize + root.thickMargins;
var maxForMinimumSize = appletItem.container.iconSize + root.thickMargins;
var maxSize = appletItem.metrics.iconSize + root.thickMargins;
var maxForMinimumSize = appletItem.metrics.iconSize + root.thickMargins;
if ( isSystray
|| appletItem.needsFillSpace
@ -785,7 +785,7 @@ Item {
TitleTooltipParent{
id: titleTooltipParent
container: appletItem.container
metrics: appletItem.metrics
}
}
@ -823,7 +823,7 @@ Item {
width: {
if (root.isHorizontal) {
return appletItem.container.iconSize * wrapper.zoomScale
return appletItem.metrics.iconSize * wrapper.zoomScale
} else {
return badgeThickness;
}
@ -833,17 +833,17 @@ Item {
if (root.isHorizontal) {
return badgeThickness;
} else {
return appletItem.container.iconSize * wrapper.zoomScale
return appletItem.metrics.iconSize * wrapper.zoomScale
}
}
readonly property int badgeThickness: {
if (plasmoid.location === PlasmaCore.Types.BottomEdge
|| plasmoid.location === PlasmaCore.Types.RightEdge) {
return ((appletItem.container.iconSize + root.thickMargin) * wrapper.zoomScale) + root.localScreenEdgeMargin;
return ((appletItem.metrics.iconSize + root.thickMargin) * wrapper.zoomScale) + root.localScreenEdgeMargin;
}
return ((appletItem.container.iconSize + root.thickMargin) * wrapper.zoomScale);
return ((appletItem.metrics.iconSize + root.thickMargin) * wrapper.zoomScale);
}
ShortcutBadge{
@ -902,7 +902,7 @@ Item {
// width: root.isHorizontal ? parent.width : parent.width - root.localScreenEdgeMargin
// height: root.isHorizontal ? parent.height - root.localScreenEdgeMargin : parent.height
radius: appletItem.container.iconSize/10
radius: appletItem.metrics.iconSize/10
opacity: root.addLaunchersMessage ? 1 : 0
backgroundOpacity: 0.75
duration: appletItem.animations.speedFactor.current

@ -49,7 +49,7 @@ Item{
var constrainedWidth = MathTools.bound(applet.Layout.minimumWidth, applet.Layout.preferredWidth, maximumValue);
return root.inConfigureAppletsMode ? Math.max(constrainedWidth, appletItem.container.iconSize) : constrainedWidth;
return root.inConfigureAppletsMode ? Math.max(constrainedWidth, appletItem.metrics.iconSize) : constrainedWidth;
}
if(appletItem.sizeForFill>-1){
@ -61,7 +61,7 @@ Item{
return latteApplet.tasksWidth;
} else {
if (root.isHorizontal && root.inConfigureAppletsMode) {
return Math.max(Math.min(appletItem.container.iconSize, root.minAppletLengthInConfigure), scaledWidth);
return Math.max(Math.min(appletItem.metrics.iconSize, root.minAppletLengthInConfigure), scaledWidth);
}
return root.isVertical ? scaledWidth + root.localScreenEdgeMargin : scaledWidth;
@ -84,7 +84,7 @@ Item{
var constrainedHeight = MathTools.bound(applet.Layout.minimumHeight, applet.Layout.preferredHeight, maximumValue);
return root.inConfigureAppletsMode ? Math.max(constrainedHeight, appletItem.container.iconSize) : constrainedHeight;
return root.inConfigureAppletsMode ? Math.max(constrainedHeight, appletItem.metrics.iconSize) : constrainedHeight;
}
if (appletItem.sizeForFill>-1){
@ -96,7 +96,7 @@ Item{
return latteApplet.tasksHeight;
} else {
if (root.isVertical && root.inConfigureAppletsMode) {
return Math.max(Math.min(appletItem.container.iconSize, root.minAppletLengthInConfigure), scaledHeight);
return Math.max(Math.min(appletItem.metrics.iconSize, root.minAppletLengthInConfigure), scaledHeight);
}
return root.isHorizontal ? scaledHeight + root.localScreenEdgeMargin : scaledHeight;
@ -123,7 +123,7 @@ Item{
property int appletMaximumWidth: applet && applet.Layout ? applet.Layout.maximumWidth : -1
property int appletMaximumHeight: applet && applet.Layout ? applet.Layout.maximumHeight : -1
property int iconSize: appletItem.container.iconSize
property int iconSize: appletItem.metrics.iconSize
property int marginWidth: root.isVertical ?
root.thickMargins :
@ -187,11 +187,11 @@ Item{
console.log("Real Wrapper Height: "+wrapper.height);
console.log("-----");
console.log("Can be hovered: " + canBeHovered);
console.log("Icon size: " + appletItem.container.iconSize);
console.log("Icon size: " + appletItem.metrics.iconSize);
console.log("Thick Margins: " + root.thickMargins);
console.log("Intern. Margins: " + (root.lengthIntMargin * 2));
console.log("Intern. Margins: " + (root.lengthExtMargin * 2));
console.log("Max hovered criteria: " + (appletItem.container.iconSize + thickMargins));
console.log("Max hovered criteria: " + (appletItem.metrics.iconSize + thickMargins));
console.log("-----");
console.log("LayoutW: " + layoutWidth);
console.log("LayoutH: " + layoutHeight);
@ -307,39 +307,39 @@ Item{
if(!root.inConfigureAppletsMode) {
layoutHeight = 0;
} else {
layoutHeight = (root.isHorizontal ? appletItem.container.iconSize : Math.min(appletItem.container.iconSize, root.maxJustifySplitterSize));
layoutHeight = (root.isHorizontal ? appletItem.metrics.iconSize : Math.min(appletItem.metrics.iconSize, root.maxJustifySplitterSize));
}
}
else if(appletItem.isSystray && root.isHorizontal){
layoutHeight = appletItem.container.iconSize;
layoutHeight = appletItem.metrics.iconSize;
}
else{
if(applet && (applet.Layout.minimumHeight > appletItem.container.iconSize) && root.isVertical && !canBeHovered && !communicator.overlayLatteIconIsActive){
if(applet && (applet.Layout.minimumHeight > appletItem.metrics.iconSize) && root.isVertical && !canBeHovered && !communicator.overlayLatteIconIsActive){
blockParabolicEffect = true;
layoutHeight = applet.Layout.minimumHeight;
} //it is used for plasmoids that need to scale only one axis... e.g. the Weather Plasmoid
else if(applet
&& ( applet.Layout.maximumHeight < appletItem.container.iconSize
|| applet.Layout.preferredHeight > appletItem.container.iconSize
&& ( applet.Layout.maximumHeight < appletItem.metrics.iconSize
|| applet.Layout.preferredHeight > appletItem.metrics.iconSize
|| appletItem.originalAppletBehavior)
&& root.isVertical
&& !disableScaleWidth
&& !communicator.overlayLatteIconIsActive) {
//this way improves performance, probably because during animation the preferred sizes update a lot
if((applet.Layout.maximumHeight < appletItem.container.iconSize)){
if((applet.Layout.maximumHeight < appletItem.metrics.iconSize)){
layoutHeight = applet.Layout.maximumHeight;
} else if (applet.Layout.minimumHeight > appletItem.container.iconSize){
} else if (applet.Layout.minimumHeight > appletItem.metrics.iconSize){
blockParabolicEffect = true;
layoutHeight = applet.Layout.minimumHeight;
} else if ((applet.Layout.preferredHeight > appletItem.container.iconSize)
} else if ((applet.Layout.preferredHeight > appletItem.metrics.iconSize)
|| (appletItem.originalAppletBehavior && applet.Layout.preferredHeight > 0 )){
blockParabolicEffect = true;
layoutHeight = applet.Layout.preferredHeight;
} else{
layoutHeight = appletItem.container.iconSize;
layoutHeight = appletItem.metrics.iconSize;
}
} else {
layoutHeight = appletItem.container.iconSize;
layoutHeight = appletItem.metrics.iconSize;
}
}
@ -368,41 +368,41 @@ Item{
if(!root.inConfigureAppletsMode) {
layoutWidth = 0;
} else {
layoutWidth = (root.isVertical ? appletItem.container.iconSize : Math.min(appletItem.container.iconSize, root.maxJustifySplitterSize));
layoutWidth = (root.isVertical ? appletItem.metrics.iconSize : Math.min(appletItem.metrics.iconSize, root.maxJustifySplitterSize));
}
}
else if(appletItem.isSystray && root.isVertical){
layoutWidth = appletItem.container.iconSize;
layoutWidth = appletItem.metrics.iconSize;
}
else{
if(applet && (applet.Layout.minimumWidth > appletItem.container.iconSize) && root.isHorizontal && !canBeHovered && !communicator.overlayLatteIconIsActive){
if(applet && (applet.Layout.minimumWidth > appletItem.metrics.iconSize) && root.isHorizontal && !canBeHovered && !communicator.overlayLatteIconIsActive){
blockParabolicEffect = true;
layoutWidth = applet.Layout.minimumWidth;
} //it is used for plasmoids that need to scale only one axis... e.g. the Weather Plasmoid
else if(applet
&& ( applet.Layout.maximumWidth < appletItem.container.iconSize
|| applet.Layout.preferredWidth > appletItem.container.iconSize
&& ( applet.Layout.maximumWidth < appletItem.metrics.iconSize
|| applet.Layout.preferredWidth > appletItem.metrics.iconSize
|| appletItem.originalAppletBehavior)
&& root.isHorizontal
&& !disableScaleHeight
&& !communicator.overlayLatteIconIsActive){
//this way improves performance, probably because during animation the preferred sizes update a lot
if((applet.Layout.maximumWidth < appletItem.container.iconSize)){
if((applet.Layout.maximumWidth < appletItem.metrics.iconSize)){
// return applet.Layout.maximumWidth;
layoutWidth = applet.Layout.maximumWidth;
} else if (applet.Layout.minimumWidth > appletItem.container.iconSize){
} else if (applet.Layout.minimumWidth > appletItem.metrics.iconSize){
blockParabolicEffect = true;
layoutWidth = applet.Layout.minimumWidth;
} else if ((applet.Layout.preferredWidth > appletItem.container.iconSize)
} else if ((applet.Layout.preferredWidth > appletItem.metrics.iconSize)
|| (appletItem.originalAppletBehavior && applet.Layout.preferredWidth > 0 )){
blockParabolicEffect = true;
layoutWidth = applet.Layout.preferredWidth;
} else{
layoutWidth = appletItem.container.iconSize;
layoutWidth = appletItem.metrics.iconSize;
}
} else{
layoutWidth = appletItem.container.iconSize;
layoutWidth = appletItem.metrics.iconSize;
}
}
@ -427,7 +427,7 @@ Item{
return wrapper.layoutWidth;
} else {
if (plasmoid.formFactor === PlasmaCore.Types.Vertical) {
var wrapperContainerThickness = parent.zoomScaleWidth * (appletItem.container.iconSize + root.thickMargins);
var wrapperContainerThickness = parent.zoomScaleWidth * (appletItem.metrics.iconSize + root.thickMargins);
return appletItem.screenEdgeMarginSupported ? wrapperContainerThickness + root.localScreenEdgeMargin : wrapperContainerThickness;
} else {
return parent.zoomScaleWidth * wrapper.layoutWidth;
@ -444,7 +444,7 @@ Item{
return wrapper.layoutHeight;
} else {
if (plasmoid.formFactor === PlasmaCore.Types.Horizontal) {
var wrapperContainerThickness = parent.zoomScaleHeight * (appletItem.container.iconSize + root.thickMargins);
var wrapperContainerThickness = parent.zoomScaleHeight * (appletItem.metrics.iconSize + root.thickMargins);
return appletItem.screenEdgeMarginSupported ? wrapperContainerThickness + root.localScreenEdgeMargin : wrapperContainerThickness;
} else {
return parent.zoomScaleHeight * wrapper.layoutHeight;
@ -605,7 +605,7 @@ Item{
PlasmaCore.SvgItem{
id:splitterImage
anchors.centerIn: parent
width: Math.min(root.maxJustifySplitterSize, appletItem.container.iconSize)
width: Math.min(root.maxJustifySplitterSize, appletItem.metrics.iconSize)
height: width
rotation: root.isVertical ? 90 : 0

@ -101,13 +101,13 @@ Loader{
// when iconSize < 48, height is always = 24, height / iconSize > 50%
// we prefer center aligned badges to top-left aligned ones
property bool centerInParent: appletItem.container.iconSize < 48
property bool centerInParent: appletItem.metrics.iconSize < 48
anchors.left: centerInParent? undefined : parent.left
anchors.top: centerInParent? undefined : parent.top
anchors.centerIn: centerInParent? parent : undefined
minimumWidth: 0.4 * (wrapper.zoomScale * appletItem.container.iconSize)
height: Math.max(24, 0.4 * (wrapper.zoomScale * appletItem.container.iconSize))
minimumWidth: 0.4 * (wrapper.zoomScale * appletItem.metrics.iconSize)
height: Math.max(24, 0.4 * (wrapper.zoomScale * appletItem.metrics.iconSize))
borderColor: colorizerManager.originalLightTextColor
proportion: 0

@ -31,10 +31,10 @@ Item{
property int size: 1
property int thickness: Math.min(Math.max(minimumThickness, preferredThickness), maximumThickness)
property int minimumThickness: 0
readonly property int preferredThickness: (root.zoomFactor * (container.iconSize + root.thickMargins)) + root.localScreenEdgeMargin
readonly property int preferredThickness: (root.zoomFactor * (metrics.iconSize + root.thickMargins)) + root.localScreenEdgeMargin
property int maximumThickness: 9999
property Item container: null
property Item metrics: null
//border.width: 1
//border.color: "green"
//color: "transparent"

@ -86,7 +86,7 @@ Item{
// USE CASE: it can be used from applets that want their size to be always
// relevant to the view icon size
// @since: 0.9
readonly property int iconSize: appletItem.container.iconSize
readonly property int iconSize: appletItem.metrics.iconSize
// NAME: screenEdgeMargin
// USAGE: read-only
@ -116,7 +116,7 @@ Item{
readonly property Item actions: Actions{}
readonly property Item applet: mainCommunicator.requires
readonly property Item animations: appletItem.animations.publicApi
readonly property Item container: appletItem.container.publicApi
readonly property Item metrics: appletItem.metrics.publicApi
Connections {
target: root

@ -56,8 +56,8 @@ Item{
readonly property int windowsCount: 0
readonly property int windowsMinimizedCount: 0
readonly property int currentIconSize: appletIsValid ? appletItem.container.iconSize : container.iconSize
readonly property int maxIconSize: appletIsValid ? appletItem.container.maxIconSize : container.maxIconSize
readonly property int currentIconSize: appletIsValid ? appletItem.metrics.iconSize : metrics.iconSize
readonly property int maxIconSize: appletIsValid ? appletItem.metrics.maxIconSize : metrics.maxIconSize
readonly property real scaleFactor: appletIsValid ? appletItem.wrapperAlias.zoomScale : 1
readonly property real panelOpacity: root.currentPanelOpacity
readonly property color shadowColor: root.appShadowColorSolid

@ -66,8 +66,8 @@ Loader {
readonly property bool locked: appletItem.lockZoom || root.zoomFactor === 1
property real visualLockedWidth: appletItem.container.iconSize + appletItem.internalWidthMargins
property real visualLockedHeight: appletItem.container.iconSize + appletItem.internalHeightMargins
property real visualLockedWidth: appletItem.metrics.iconSize + appletItem.internalWidthMargins
property real visualLockedHeight: appletItem.metrics.iconSize + appletItem.internalHeightMargins
//! Communications !//

@ -44,8 +44,8 @@ Item{
property int speed: LatteCore.WindowSystem.compositingActive ? animations.speedFactor.normal*3.6*animations.duration.large : 10
property int thickness: visibilityManager.thicknessEditMode + root.editShadow
property int rootThickness: visibilityManager.thicknessZoomOriginal + root.editShadow //- visibilityManager.thicknessEditMode
property int editLength: root.isHorizontal ? (root.behaveAsPlasmaPanel ? root.width - container.maxIconSize/4 : root.width)://root.maxLength) :
(root.behaveAsPlasmaPanel ? root.height - container.maxIconSize/4 : root.height)
property int editLength: root.isHorizontal ? (root.behaveAsPlasmaPanel ? root.width - metrics.maxIconSize/4 : root.width)://root.maxLength) :
(root.behaveAsPlasmaPanel ? root.height - metrics.maxIconSize/4 : root.height)
property bool farEdge: (plasmoid.location===PlasmaCore.Types.BottomEdge) || (plasmoid.location===PlasmaCore.Types.RightEdge)
property bool editAnimationEnded: false
@ -221,7 +221,7 @@ Item{
Applet.TitleTooltipParent {
id: titleTooltipParent
container: root.container
metrics: root.metrics
minimumThickness: visibilityManager.thicknessEditMode
maximumThickness: root.inConfigureAppletsMode ? visibilityManager.thicknessEditMode : 9999
}

@ -45,7 +45,7 @@ Loader {
acceptedButtons: Qt.LeftButton | Qt.MidButton
readonly property int localThickness: (root.isHovered ? (container.iconSize + root.thickMargins)*root.zoomFactor : (container.iconSize + root.thickMargins))
readonly property int localThickness: (root.isHovered ? (metrics.iconSize + root.thickMargins)*root.zoomFactor : (metrics.iconSize + root.thickMargins))
readonly property int length: {
if (screenEdgeMarginEnabled && plasmoid.configuration.fittsLawIsRequested) {
return root.isHorizontal ? root.width : root.height;

@ -289,7 +289,7 @@ Item{
}
Connections {
target: container
target: metrics
onIconSizeAnimationEnded: delayUpdateMaskArea.start();
}

@ -50,8 +50,8 @@ Item{
readonly property int windowsCount: 0
readonly property int windowsMinimizedCount: 0
readonly property int currentIconSize: container.iconSize
readonly property int maxIconSize: container.maxIconSize
readonly property int currentIconSize: metrics.iconSize
readonly property int maxIconSize: metrics.maxIconSize
readonly property real scaleFactor: 1
readonly property real panelOpacity: root.currentPanelOpacity
readonly property color shadowColor: root.appShadowColorSolid

@ -321,8 +321,8 @@ Item {
}
property int appShadowOpacity: (plasmoid.configuration.shadowOpacity/100) * 255
property int appShadowSize: enableShadows ? (0.5*container.iconSize) * (plasmoid.configuration.shadowSize/100) : 0
property int appShadowSizeOriginal: enableShadows ? (0.5*container.maxIconSize) * (plasmoid.configuration.shadowSize/100) : 0
property int appShadowSize: enableShadows ? (0.5*metrics.iconSize) * (plasmoid.configuration.shadowSize/100) : 0
property int appShadowSizeOriginal: enableShadows ? (0.5*metrics.maxIconSize) * (plasmoid.configuration.shadowSize/100) : 0
property string appChosenShadowColor: {
if (plasmoid.configuration.shadowColorType === LatteContainment.Types.ThemeColorShadow) {
@ -377,13 +377,13 @@ Item {
property int themePanelThickness: {
var panelBase = root.panelThickMarginHigh + root.panelThickMarginBase;
var margin = shrinkThickMargins ? 0 : thickMargins + localScreenEdgeMargin;
var maxPanelSize = (container.iconSize + margin) - panelBase;
var maxPanelSize = (metrics.iconSize + margin) - panelBase;
var percentage = LatteCore.WindowSystem.compositingActive ? plasmoid.configuration.panelSize/100 : 1;
return Math.max(panelBase, panelBase + percentage*maxPanelSize);
}
property int lengthIntMargin: lengthIntMarginFactor * container.iconSize
property int lengthExtMargin: lengthExtMarginFactor * container.iconSize
property int lengthIntMargin: lengthIntMarginFactor * metrics.iconSize
property int lengthExtMargin: lengthExtMarginFactor * metrics.iconSize
property real lengthIntMarginFactor: indicators.isEnabled ? indicators.padding : 0
property real lengthExtMarginFactor: plasmoid.configuration.lengthExtMargin / 100
@ -397,7 +397,7 @@ Item {
//0.075 old statesLineSize and 0.06 old default thickMargin
return Math.max(indicators.info.minThicknessPadding, plasmoid.configuration.thickMargin / 100)
}
property int thickMargin: thickMarginFactor * container.iconSize
property int thickMargin: thickMarginFactor * metrics.iconSize
property bool screenEdgeMarginEnabled: plasmoid.configuration.screenEdgeMargin >= 0 && !plasmoid.configuration.shrinkThickMargins
property int screenEdgeMargin: {
@ -420,7 +420,7 @@ Item {
//it is used in order to not break the calculations for the thickness placement
//especially in automatic icon sizes calculations
property int maxThickMargin: thickMarginFactor * container.maxIconSize
property int maxThickMargin: thickMarginFactor * metrics.maxIconSize
property int lengthMargin: lengthIntMargin + lengthExtMargin
property int lengthMargins: 2 * lengthMargin
@ -460,8 +460,8 @@ Item {
readonly property alias animations: _animations
readonly property alias appletsRecords: _appletsRecords
readonly property alias autosize: _autosize
readonly property alias container: _container
readonly property alias indicatorsManager: indicators
readonly property alias metrics: _metrics
readonly property alias parabolicManager: _parabolicManager
readonly property alias maskManager: visibilityManager
@ -542,7 +542,7 @@ Item {
///The index of user's current icon size
property int currentIconIndex:{
for(var i=iconsArray.length-1; i>=0; --i){
if(iconsArray[i] === container.iconSize){
if(iconsArray[i] === metrics.iconSize){
return i;
}
}
@ -713,11 +713,11 @@ Item {
// currentLayout.isLayoutHorizontal = isHorizontal
LayoutManager.plasmoid = plasmoid;
LayoutManager.root = root;
LayoutManager.container = container;
LayoutManager.layout = layoutsContainer.mainLayout;
LayoutManager.layoutS = layoutsContainer.startLayout;
LayoutManager.layoutE = layoutsContainer.endLayout;
LayoutManager.lastSpacer = lastSpacer;
LayoutManager.metrics = metrics;
upgrader_v010_alignment();
@ -1525,7 +1525,7 @@ Item {
Applet.AppletItem{
animations: _animations
appletsRecords: _appletsRecords
container: _container
metrics: _metrics
}
}
@ -1648,8 +1648,8 @@ Item {
width: root.isHorizontal ? length : thickness
height: root.isHorizontal ? thickness : length
readonly property int length: container.iconSize + root.lengthMargins
readonly property int thickness: container.iconSize + root.thickMargins + root.localScreenEdgeMargin
readonly property int length: metrics.iconSize + root.lengthMargins
readonly property int thickness: metrics.iconSize + root.thickMargins + root.localScreenEdgeMargin
Layout.preferredWidth: width
Layout.preferredHeight: height
@ -1732,7 +1732,7 @@ Item {
Ability.Animations {
id: _animations
container: _container
metrics: _metrics
settings: universalSettings
}
@ -1742,13 +1742,13 @@ Item {
Ability.AutoSize {
id: _autosize
container: _container
layouts: layoutsContainer
metrics: _metrics
visibility: visibilityManager
}
Ability.Container {
id: _container
Ability.Metrics {
id: _metrics
animations: _animations
autosize: _autosize
}

@ -21,12 +21,17 @@ import QtQuick 2.0
import org.kde.latte.abilities.definitions 0.1 as AbilityDefinition
AbilityDefinition.Container {
AbilityDefinition.Metrics {
id: apis
property Item bridge: null
iconSize: bridge ? bridge.container.iconSize : local.iconSize
maxIconSize: bridge ? bridge.container.maxIconSize : local.iconSize
Item {
id: refs
readonly property Item metrics: bridge ? bridge.metrics : local
}
readonly property AbilityDefinition.Container local: AbilityDefinition.Container {}
iconSize: refs.metrics.iconSize
maxIconSize: refs.metrics.maxIconSize
readonly property AbilityDefinition.Metrics local: AbilityDefinition.Metrics {}
}

@ -1,5 +1,5 @@
module org.kde.latte.abilities.applets
Animations 0.1 Animations.qml
Container 0.1 Container.qml
Metrics 0.1 Metrics.qml
Requirements 0.1 Requirements.qml

@ -21,7 +21,7 @@ import QtQuick 2.0
import org.kde.latte.abilities.definitions 0.1 as AbilityDefinition
AbilityDefinition.Container {
AbilityDefinition.Metrics {
id: apis
readonly property Item publicApi: Item {

@ -1,4 +1,4 @@
module org.kde.latte.abilities.containers
Animations 0.1 Animations.qml
Container 0.1 Container.qml
Metrics 0.1 Metrics.qml

@ -2,5 +2,5 @@ module org.kde.latte.abilities.definitions
Animations 0.1 Animations.qml
AppletRequirements 0.1 AppletRequirements.qml
Container 0.1 Container.qml
Metrics 0.1 Metrics.qml

@ -122,7 +122,7 @@ function insertIndexAt(above, x, y) {
} else {
var distance = root.vertical ? y : x;
//var step = root.vertical ? LayoutManager.taskWidth() : LayoutManager.taskHeight();
var step = container.iconSize + root.lengthMargins;
var step = metrics.iconSize + root.lengthMargins;
var stripe = Math.ceil(distance / step);
/* if (stripe === LayoutManager.calculateStripes()) {

@ -23,7 +23,7 @@ import org.kde.plasma.plasmoid 2.0
import org.kde.latte.abilities.applets 0.1 as AppletAbility
AppletAbility.Container {
AppletAbility.Metrics {
//! Public Local Properties
local.iconSize: Math.max(plasmoid.configuration.iconSize, 16)
}

@ -140,7 +140,7 @@ Item {
property Item parabolicManager: _parabolicManager
property Item tasksExtendedManager: _tasksExtendedManager
readonly property alias animations: _animations
readonly property alias container: _container
readonly property alias metrics: _metrics
readonly property alias containsDrag: mouseHandler.containsDrag
readonly property bool dragAreaEnabled: latteView ? (root.dragSource !== null
@ -218,10 +218,10 @@ Item {
}
}
property int thickMargin: latteView ? latteView.thickMargin : 0.16*container.iconSize
property int thickMargin: latteView ? latteView.thickMargin : 0.16*metrics.iconSize
property int thickMargins: 2 * thickMargin
property int lengthIntMargin: latteView ? latteView.lengthIntMargin : 0.04 * container.iconSize
property int lengthExtMargin: latteView ? latteView.lengthExtMargin : 0.1 * container.iconSize
property int lengthIntMargin: latteView ? latteView.lengthIntMargin : 0.04 * metrics.iconSize
property int lengthExtMargin: latteView ? latteView.lengthExtMargin : 0.1 * metrics.iconSize
property int lengthMargin: lengthIntMargin + lengthExtMargin
property int lengthMargins: 2 * lengthMargin
@ -236,7 +236,7 @@ Item {
property real zoomFactor: latteView ? latteView.zoomFactor : ( 1 + (plasmoid.configuration.zoomLevel / 20) )
property int appShadowSize: latteView ? latteView.appShadowSize : Math.ceil(0.12*container.iconSize)
property int appShadowSize: latteView ? latteView.appShadowSize : Math.ceil(0.12*metrics.iconSize)
property string appShadowColor: latteView ? latteView.appShadowColor : "#ff080808"
property string appShadowColorSolid: latteView ? latteView.appShadowColorSolid : "#ff080808"
@ -947,8 +947,8 @@ Item {
bridge: latteBridge
}
Ability.Container {
id: _container
Ability.Metrics {
id: _metrics
bridge: latteBridge
}
@ -1052,15 +1052,15 @@ Item {
anchors.horizontalCenter: !root.vertical ? parent.horizontalCenter : undefined
anchors.verticalCenter: root.vertical ? parent.verticalCenter : undefined
width: root.vertical ? 1 : 2 * container.iconSize
height: root.vertical ? 2 * container.iconSize : 1
width: root.vertical ? 1 : 2 * metrics.iconSize
height: root.vertical ? 2 * metrics.iconSize : 1
color: "red"
x: (root.location === PlasmaCore.Types.LeftEdge) ? neededSpace : parent.width - neededSpace
y: (root.location === PlasmaCore.Types.TopEdge) ? neededSpace : parent.height - neededSpace
visible: plasmoid.configuration.zoomHelper
property int neededSpace: zoomFactor*(container.iconSize+lengthMargins)
property int neededSpace: zoomFactor*(metrics.iconSize+lengthMargins)
}
Item{
@ -1076,8 +1076,8 @@ Item {
width: ( icList.orientation === Qt.Horizontal ) ? icList.width + spacing : smallSize
height: ( icList.orientation === Qt.Vertical ) ? icList.height + spacing : smallSize
property int spacing: latteView ? 0 : container.iconSize / 2
property int smallSize: Math.max(0.10 * container.iconSize, 16)
property int spacing: latteView ? 0 : metrics.iconSize / 2
property int smallSize: Math.max(0.10 * metrics.iconSize, 16)
Behavior on opacity{
NumberAnimation { duration: animations.speedFactor.current*animations.duration.large }
@ -1174,8 +1174,8 @@ Item {
visible: root.dragAreaEnabled
property int maxSize: (((root.hoveredIndex>=0 || dockHoveredIndex>=0 ) || windowPreviewIsShown) && !root.dragSource) ?
root.zoomFactor * (container.iconSize + root.thickMargins) + root.screenEdgeMargin :
container.iconSize + root.thickMargins + root.screenEdgeMargin
root.zoomFactor * (metrics.iconSize + root.thickMargins) + root.screenEdgeMargin :
metrics.iconSize + root.thickMargins + root.screenEdgeMargin
function onlyLaunchersInList(list){
return list.every(function (item) {
@ -1237,7 +1237,7 @@ Item {
return animations.hasThicknessAnimation ? latteView.maskManager.thicknessNormal : latteView.maskManager.thicknessZoom;
}
return (root.thickMargins + container.iconSize) * root.zoomFactor;
return (root.thickMargins + metrics.iconSize) * root.zoomFactor;
}
//onCurrentPosChanged: console.log("CP :: "+ currentPos + " icW:"+icList.width + " rw: "+root.width + " w:" +width);
@ -1269,7 +1269,7 @@ Item {
orientation: plasmoid.formFactor === PlasmaCore.Types.Vertical ? Qt.Vertical : Qt.Horizontal
delegate: Task.TaskItem{
animations: _animations
container: _container
metrics: _metrics
requires: _requires
}
@ -1362,7 +1362,7 @@ Item {
id: newDroppedLauncherVisual
anchors.fill: parent
visible: backgroundOpacity > 0
radius: container.iconSize/10
radius: metrics.iconSize/10
backgroundOpacity: root.dropNewLauncher && mouseHandler.onlyLaunchers && (root.dragSource == null)? 0.75 : 0
duration: animations.speedFactor.current

@ -63,7 +63,7 @@ Item{
} else if (!inAttentionAnimation && !inMimicParabolicAnimation && !inFastRestoreAnimation) {
return (nScale > 0) ? (taskItem.spacersMaxSize * nScale) + separatorSpace : separatorSpace;
} else {
return (nScale > 0) ? (taskItem.container.iconSize * nScale) + separatorSpace : separatorSpace;
return (nScale > 0) ? (taskItem.metrics.iconSize * nScale) + separatorSpace : separatorSpace;
}
}
}

@ -118,12 +118,12 @@ Item{
TitleTooltipParent{
id: titleTooltipParent
thickness: root.zoomFactor * (taskItem.container.iconSize + root.thickMargins)
thickness: root.zoomFactor * (taskItem.metrics.iconSize + root.thickMargins)
}
TitleTooltipParent{
id: previewsTooltipParent
thickness: root.zoomFactor * (taskItem.container.iconSize + root.thickMargins) + 1
thickness: root.zoomFactor * (taskItem.metrics.iconSize + root.thickMargins) + 1
}
//!
@ -185,12 +185,12 @@ Item{
}
}
property int zoomedSize: root.zoomFactor * taskItem.container.iconSize
property int zoomedSize: root.zoomFactor * taskItem.metrics.iconSize
property real basicScalingWidth : wrapper.inTempScaling ? (taskItem.container.iconSize * wrapper.scaleWidth) :
taskItem.container.iconSize * wrapper.mScale
property real basicScalingHeight : wrapper.inTempScaling ? (taskItem.container.iconSize * wrapper.scaleHeight) :
taskItem.container.iconSize * wrapper.mScale
property real basicScalingWidth : wrapper.inTempScaling ? (taskItem.metrics.iconSize * wrapper.scaleWidth) :
taskItem.metrics.iconSize * wrapper.mScale
property real basicScalingHeight : wrapper.inTempScaling ? (taskItem.metrics.iconSize * wrapper.scaleHeight) :
taskItem.metrics.iconSize * wrapper.mScale
property real newTempSize: {
if (wrapper.opacity === 1 ) {
@ -599,8 +599,8 @@ Item{
height: !root.vertical ? thickness : length
anchors.centerIn: parent
readonly property int length: taskItem.container.iconSize + root.lengthMargins
readonly property int thickness: taskItem.container.iconSize + root.thickMargins
readonly property int length: taskItem.metrics.iconSize + root.lengthMargins
readonly property int thickness: taskItem.metrics.iconSize + root.thickMargins
readonly property real applyOpacity: root.dropNewLauncher && !mouseHandler.onlyLaunchers
&& (root.dragSource == null) && (mouseHandler.hoveredItem === taskItem) ? 0.7 : 0
@ -787,7 +787,7 @@ Item{
if(!running){
var halfZoom = 1 + ((root.zoomFactor - 1) / 2);
wrapper.calculateScales((taskItem.container.iconSize+root.thickMargins)/2);
wrapper.calculateScales((taskItem.metrics.iconSize+root.thickMargins)/2);
taskItem.animationEnded();
// root.animations--;

@ -63,7 +63,7 @@ Item {
if (showsAudioBadge) {
return height;
} else if ( index === parabolicManager.firstRealTaskIndex && !taskItem.containsMouse) {
return (wrapper.mScale * (taskItem.container.iconSize - (root.enableShadows ? shadowSize/2 : 0)));
return (wrapper.mScale * (taskItem.metrics.iconSize - (root.enableShadows ? shadowSize/2 : 0)));
} else {
return 999999;
}

@ -59,13 +59,13 @@ Loader{
id: taskNumber
// when iconSize < 48, height is always = 24, height / iconSize > 50%
// we prefer center aligned badges to top-left aligned ones
property bool centerInParent: taskItem.container.iconSize < 48
property bool centerInParent: taskItem.metrics.iconSize < 48
anchors.left: centerInParent? undefined : parent.left
anchors.top: centerInParent? undefined : parent.top
anchors.centerIn: centerInParent? parent : undefined
minimumWidth: 0.4 * (wrapper.mScale * taskItem.container.iconSize)
height: Math.max(24, 0.4 * (wrapper.mScale * taskItem.container.iconSize))
minimumWidth: 0.4 * (wrapper.mScale * taskItem.metrics.iconSize)
height: Math.max(24, 0.4 * (wrapper.mScale * taskItem.metrics.iconSize))
style3d: root.badges3DStyle
textValue: shorcutBadge.badgeString

@ -53,7 +53,7 @@ MouseArea{
if (isSeparator) {
if (root.vertical) {
return taskItem.container.iconSize + root.thickMargins + root.screenEdgeMargin;
return taskItem.metrics.iconSize + root.thickMargins + root.screenEdgeMargin;
} else {
if (root.dragSource || !root.parabolicEffectEnabled) {
return LatteCore.Environment.separatorLength+2*root.lengthExtMargin;
@ -80,7 +80,7 @@ MouseArea{
if (isSeparator) {
if (!root.vertical) {
return taskItem.container.iconSize + root.thickMargins + root.screenEdgeMargin;
return taskItem.metrics.iconSize + root.thickMargins + root.screenEdgeMargin;
} else {
if (root.dragSource || !root.parabolicEffectEnabled) {
return LatteCore.Environment.separatorLength+2*root.lengthExtMargin;
@ -138,7 +138,7 @@ MouseArea{
property bool isWindow: (IsWindow === true) ? true : false
property bool isZoomed: false
property bool canPublishGeometries: (isWindow || isStartup || isGroupParent) && visible && width>=taskItem.container.iconSize && height>=taskItem.container.iconSize
property bool canPublishGeometries: (isWindow || isStartup || isGroupParent) && visible && width>=taskItem.metrics.iconSize && height>=taskItem.metrics.iconSize
&& !taskItem.delayingRemove
&& (wrapper.mScale===1 || wrapper.mScale===root.zoomFactor) //don't publish during zoomFactor
@ -154,7 +154,7 @@ MouseArea{
property int pressX: -1
property int pressY: -1
property int resistanceDelay: 450
property int spacersMaxSize: Math.max(0,Math.ceil(0.55*taskItem.container.iconSize) - root.lengthMargins)
property int spacersMaxSize: Math.max(0,Math.ceil(0.55*taskItem.metrics.iconSize) - root.lengthMargins)
property int windowsCount: subWindows.windowsCount
property int windowsMinimizedCount: subWindows.windowsMinimized
@ -180,7 +180,7 @@ MouseArea{
//abilities
property Item animations: null
property Item container: null
property Item metrics: null
property Item requires: null
onModelLauncherUrlChanged: {
@ -350,8 +350,8 @@ MouseArea{
opacity: (separatorShadow.active) || forceHiddenState ? 0 : 0.4
visible: taskItem.isSeparator
width: root.vertical ? taskItem.container.iconSize : ((root.dragSource || root.editMode) ? LatteCore.Environment.separatorLength+root.lengthMargins: 1)
height: !root.vertical ? taskItem.container.iconSize : ((root.dragSource || root.editMode) ? LatteCore.Environment.separatorLength+root.lengthMargins: 1)
width: root.vertical ? taskItem.metrics.iconSize : ((root.dragSource || root.editMode) ? LatteCore.Environment.separatorLength+root.lengthMargins: 1)
height: !root.vertical ? taskItem.metrics.iconSize : ((root.dragSource || root.editMode) ? LatteCore.Environment.separatorLength+root.lengthMargins: 1)
property bool forceHiddenState: false
@ -427,8 +427,8 @@ MouseArea{
Rectangle {
anchors.centerIn: parent
width: root.vertical ? taskItem.container.iconSize - 4 : 1
height: !root.vertical ? taskItem.container.iconSize - 4 : 1
width: root.vertical ? taskItem.metrics.iconSize - 4 : 1
height: !root.vertical ? taskItem.metrics.iconSize - 4 : 1
color: enforceLattePalette ? latteBridge.palette.textColor : theme.textColor
}
@ -1297,7 +1297,7 @@ MouseArea{
var adjX = Math.min(limits.x+limits.width, Math.max(limits.x, globalChoords.x));
var adjY = Math.min(limits.y+limits.height, Math.max(limits.y, globalChoords.y));
var length = taskItem.container.iconSize * wrapper.mScale;
var length = taskItem.metrics.iconSize * wrapper.mScale;
var thickness = length;
//! Magic Lamp effect doesn't like coordinates outside the screen and

@ -36,7 +36,7 @@ Item{
if (!root.vertical)
return 0;
else
return (taskItem.container.iconSize + root.widthMargins + root.screenEdgeMargin);
return (taskItem.metrics.iconSize + root.widthMargins + root.screenEdgeMargin);
}
if (taskItem.isStartup && taskItem.animations.speedFactor.current !==0 ) {
@ -54,7 +54,7 @@ Item{
if (root.vertical)
return 0;
else
return (taskItem.container.iconSize + root.heightMargins + root.screenEdgeMargin);
return (taskItem.metrics.iconSize + root.heightMargins + root.screenEdgeMargin);
}
if (taskItem.isStartup && taskItem.animations.speedFactor.current !==0){
@ -64,8 +64,8 @@ Item{
}
}
property int maxThickness: !root.vertical ? root.zoomFactor*(taskItem.container.iconSize+root.heightMargins)
: root.zoomFactor*(taskItem.container.iconSize+root.widthMargins)
property int maxThickness: !root.vertical ? root.zoomFactor*(taskItem.metrics.iconSize+root.heightMargins)
: root.zoomFactor*(taskItem.metrics.iconSize+root.widthMargins)
property real showDelegateWidth: basicScalingWidth
property real showDelegateHeight: basicScalingHeight
@ -81,17 +81,17 @@ Item{
property real scaleWidth: (inTempScaling == true) ? tempScaleWidth : mScale
property real scaleHeight: (inTempScaling == true) ? tempScaleHeight : mScale
property real cleanScalingWidth: (taskItem.container.iconSize + root.widthMargins) * mScale
property real cleanScalingHeight: (taskItem.container.iconSize + root.heightMargins) * mScale
property real cleanScalingWidth: (taskItem.metrics.iconSize + root.widthMargins) * mScale
property real cleanScalingHeight: (taskItem.metrics.iconSize + root.heightMargins) * mScale
property real basicScalingWidth : (inTempScaling == true) ? ((taskItem.container.iconSize + root.widthMargins) * scaleWidth) : cleanScalingWidth
property real basicScalingHeight : (inTempScaling == true) ? ((taskItem.container.iconSize + root.heightMargins) * scaleHeight) : cleanScalingHeight
property real basicScalingWidth : (inTempScaling == true) ? ((taskItem.metrics.iconSize + root.widthMargins) * scaleWidth) : cleanScalingWidth
property real basicScalingHeight : (inTempScaling == true) ? ((taskItem.metrics.iconSize + root.heightMargins) * scaleHeight) : cleanScalingHeight
property real regulatorWidth: taskItem.isSeparator ? width : basicScalingWidth;
property real regulatorHeight: taskItem.isSeparator ? height : basicScalingHeight;
property real visualScaledWidth: (taskItem.container.iconSize + root.internalWidthMargins) * mScale
property real visualScaledHeight: (taskItem.container.iconSize + root.internalHeightMargins) * mScale
property real visualScaledWidth: (taskItem.metrics.iconSize + root.internalWidthMargins) * mScale
property real visualScaledHeight: (taskItem.metrics.iconSize + root.internalHeightMargins) * mScale
/// end of Scalers///////
//property int curIndex: icList.hoveredIndex

@ -149,10 +149,10 @@ Item{
if( (root.location === PlasmaCore.Types.BottomEdge) ||
(root.location === PlasmaCore.Types.RightEdge) ){
componentRemoveAnimation.toPoint = tempPoint + taskItem.container.iconSize;
componentRemoveAnimation.toPoint = tempPoint + taskItem.metrics.iconSize;
}
else{
componentRemoveAnimation.toPoint = tempPoint - taskItem.container.iconSize;
componentRemoveAnimation.toPoint = tempPoint - taskItem.metrics.iconSize;
}
visible = true;

@ -59,8 +59,8 @@ Item {
readonly property int windowsCount: taskIsValid ? taskItem.windowsCount : 0
readonly property int windowsMinimizedCount: taskIsValid ? taskItem.windowsMinimizedCount : 0
readonly property int currentIconSize: taskIsValid ? taskItem.container.iconSize : container.iconSize
readonly property int maxIconSize: taskIsValid ? taskItem.container.maxIconSize : container.iconSize
readonly property int currentIconSize: taskIsValid ? taskItem.metrics.iconSize : metrics.iconSize
readonly property int maxIconSize: taskIsValid ? taskItem.metrics.maxIconSize : metrics.iconSize
readonly property real scaleFactor: taskIsValid ? taskItem.wrapperAlias.mScale : 1
readonly property real panelOpacity: root.currentPanelOpacity
readonly property color shadowColor: root.appShadowColorSolid

@ -58,10 +58,10 @@ Loader {
readonly property bool locked: inAttentionAnimation || inNewWindowAnimation || inBouncingAnimation
property real visualLockedWidth: root.vertical ? root.screenEdgeMargin + taskItem.container.iconSize + root.internalWidthMargins :
taskItem.container.iconSize + root.internalWidthMargins
property real visualLockedHeight: !root.vertical ? root.screenEdgeMargin + taskItem.container.iconSize + root.internalHeightMargins :
taskItem.container.iconSize + root.internalHeightMargins
property real visualLockedWidth: root.vertical ? root.screenEdgeMargin + taskItem.metrics.iconSize + root.internalWidthMargins :
taskItem.metrics.iconSize + root.internalWidthMargins
property real visualLockedHeight: !root.vertical ? root.screenEdgeMargin + taskItem.metrics.iconSize + root.internalHeightMargins :
taskItem.metrics.iconSize + root.internalHeightMargins
//! Connections !//

@ -26,8 +26,8 @@ Item {
id: shadowsContainer
opacity: 0.4
readonly property int gradientLength: container.iconSize / 3
readonly property int thickness: latteView ? latteView.realPanelSize : container.iconSize + root.thickMargins
readonly property int gradientLength: metrics.iconSize / 3
readonly property int thickness: latteView ? latteView.realPanelSize : metrics.iconSize + root.thickMargins
readonly property color appliedColor: root.appShadowColorSolid
property Item flickable

@ -24,7 +24,7 @@ import org.kde.plasma.core 2.0 as PlasmaCore
Item {
readonly property int gradientLength: container.iconSize / 3
readonly property int gradientLength: metrics.iconSize / 3
LinearGradient {
id: firstGradient

@ -56,10 +56,10 @@ Flickable{
readonly property int scrollFirstPos: 0
readonly property int scrollLastPos: contentsExtraSpace
readonly property int scrollStep: container.iconSize * 1.5
readonly property int scrollStep: metrics.iconSize * 1.5
readonly property int currentPos: !root.vertical ? contentX : contentY
readonly property int autoScrollTriggerLength: container.iconSize + root.lengthMargins/2
readonly property int autoScrollTriggerLength: metrics.iconSize + root.lengthMargins/2
readonly property int alignment: {
if (root.location === PlasmaCore.Types.LeftEdge) {
@ -140,18 +140,18 @@ Flickable{
if (!root.vertical) {
if (cP.x < 0) {
distance = Math.abs(cP.x - container.iconSize);
distance = Math.abs(cP.x - metrics.iconSize);
decreasePosWithStep(distance);
} else if ((cP.x+task.width) > scrollableList.width) {
distance = Math.abs(cP.x - scrollableList.width + task.width + container.iconSize);
distance = Math.abs(cP.x - scrollableList.width + task.width + metrics.iconSize);
increasePosWithStep(distance);
}
} else {
if (cP.y < 0) {
distance = Math.abs(cP.y - container.iconSize);
distance = Math.abs(cP.y - metrics.iconSize);
decreasePosWithStep(distance);
} else if ((cP.y+task.height) > scrollableList.height) {
distance = Math.abs(cP.y - scrollableList.height + task.height + container.iconSize);
distance = Math.abs(cP.y - scrollableList.height + task.height + metrics.iconSize);
increasePosWithStep(distance);
}
}
@ -176,15 +176,15 @@ Flickable{
if (!root.vertical) {
if (currentPos !== scrollFirstPos && cP.x < autoScrollTriggerLength) {
decreasePosWithStep(container.iconSize*1.5);
decreasePosWithStep(metrics.iconSize*1.5);
} else if (currentPos !== scrollLastPos && (cP.x+task.width > (scrollableList.width-autoScrollTriggerLength))) {
increasePosWithStep(container.iconSize*1.5);
increasePosWithStep(metrics.iconSize*1.5);
}
} else {
if (currentPos !== scrollFirstPos && cP.y < autoScrollTriggerLength) {
decreasePosWithStep(container.iconSize*1.5);
decreasePosWithStep(metrics.iconSize*1.5);
} else if (currentPos !== scrollLastPos && (cP.y+task.height > (scrollableList.height-autoScrollTriggerLength))) {
increasePosWithStep(container.iconSize*1.5);
increasePosWithStep(metrics.iconSize*1.5);
}
}

Loading…
Cancel
Save