multiple fixes for different margins

--multiple fixes for margins all over the place. More
specific how they are calculated and when they are
used
pull/9/head
Michail Vourlakos 5 years ago
parent cb7dbf0db9
commit fb026b1cac

@ -131,9 +131,21 @@ 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 * root.iconSize) - root.lengthAppletMargins)
property int spacersMaxSize: Math.max(0,Math.ceil(0.55 * root.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 * root.iconSize
property int lengthAppletFullMargin: lengthAppletIntMargin + root.lengthExtMargin
property int lengthAppletFullMargins: 2 * lengthAppletFullMargin
property int internalWidthMargins: root.isVertical ? root.thickMargins : 2 * lengthAppletIntMargin
property int internalHeightMargins: root.isHorizontal ? root.thickMargins : 2 * lengthAppletIntMargin
//! are set by the indicator
property int iconOffsetX: 0
property int iconOffsetY: 0
@ -236,6 +248,13 @@ Item {
to: 0
}
Behavior on lengthAppletIntMargin {
NumberAnimation {
duration: 0.8 * root.animationTime
easing.type: Easing.OutCubic
}
}
//// END :: Animate Applet when a new applet is dragged in the view
/// BEGIN functions

@ -45,9 +45,9 @@ Item{
property bool rightSpacer: false
readonly property bool atEdgeForcingFittsLaw: !isSeparator && !root.parabolicEffectEnabled && root.inFullJustify && atScreenEdge && !isSquare
readonly property bool atEdgeForcingFittsLaw: !isSeparator && !parabolicEffectMarginsEnabled && atScreenEdge
readonly property int subtrackedMargins: atEdgeForcingFittsLaw && ((startEdge && rightSpacer) || (endEdge && !rightSpacer )) ?
root.lengthAppletIntMargin + root.lengthExtMargin : 0
root.lengthExtMargin : 0
property real nScale: 0

@ -117,13 +117,13 @@ Item{
property int marginWidth: root.isVertical ?
root.thickMargins :
(root.inFullJustify && atScreenEdge ? edgeLengthMargins : localLengthMargins) //Fitt's Law
(root.inFullJustify && atScreenEdge && !parabolicEffectMarginsEnabled ? edgeLengthMargins : localLengthMargins) //Fitt's Law
property int marginHeight: root.isHorizontal ?
root.thickMargins :
(root.inFullJustify && atScreenEdge ? edgeLengthMargins : localLengthMargins) //Fitt's Law
(root.inFullJustify && atScreenEdge && !parabolicEffectMarginsEnabled ? edgeLengthMargins : localLengthMargins) //Fitt's Law
property int localLengthMargins: isSeparator || !communicator.lengthMarginsEnabled ? 0 : root.lengthAppletMargins
property int edgeLengthMargins: isSeparator || !communicator.lengthMarginsEnabled || !isSquare ? 0 : root.lengthAppletMargins
property int localLengthMargins: isSeparator || !communicator.lengthMarginsEnabled ? 0 : appletItem.lengthAppletFullMargins
property int edgeLengthMargins: isSeparator || !communicator.lengthMarginsEnabled || !isSquare ? 0 : appletItem.lengthAppletIntMargin * 2
property real scaledWidth: zoomScaleWidth * (layoutWidth + marginWidth)
property real scaledHeight: zoomScaleHeight * (layoutHeight + marginHeight)

@ -42,18 +42,13 @@ Loader {
return indicators.indicatorComponent;
}
width: root.isHorizontal && !(root.inFullJustify && atScreenEdge /*Fitt's Law*/ && !isSquare) && canBeHovered ?
appletItem.wrapperAlias.width - 2*appletItem.wrapperAlias.zoomScale*root.lengthExtMargin
: appletItem.wrapperAlias.width
height: root.isVertical && !(root.inFullJustify && atScreenEdge /*Fitt's Law*/ && !isSquare) && canBeHovered ?
appletItem.wrapperAlias.height - 2*appletItem.wrapperAlias.zoomScale*root.lengthExtMargin :
appletItem.wrapperAlias.height
width: root.isHorizontal && canBeHovered ? appletItem.wrapperAlias.zoomScale * visualLockedWidth : appletItem.wrapperAlias.width
height: root.isVertical && canBeHovered ? appletItem.wrapperAlias.zoomScale * visualLockedHeight : appletItem.wrapperAlias.height
readonly property bool locked: appletItem.lockZoom || root.zoomFactor === 1
property real visualLockedWidth: root.iconSize + root.internalWidthMargins
property real visualLockedHeight: root.iconSize + root.internalHeightMargins
property real visualLockedWidth: root.iconSize + appletItem.internalWidthMargins
property real visualLockedHeight: root.iconSize + appletItem.internalHeightMargins
//! Communications !//

@ -49,7 +49,7 @@ Item{
readonly property bool needsMouseEventCoordinates: infoLoaded && metricsLoader.item.hasOwnProperty("needsMouseEventCoordinates")
&& metricsLoader.item.needsMouseEventCoordinates
readonly property bool providesFrontLayer: minfoLoaded && metricsLoader.item.hasOwnProperty("providesFrontLayer")
readonly property bool providesFrontLayer: infoLoaded && metricsLoader.item.hasOwnProperty("providesFrontLayer")
&& metricsLoader.item.providesFrontLayer
readonly property bool providesHoveredAnimation: infoLoaded && metricsLoader.item.hasOwnProperty("providesHoveredAnimation")

@ -383,8 +383,7 @@ Item {
property real lengthIntMarginFactor: indicators.isEnabled ? indicators.padding : 0
property real lengthExtMarginFactor: plasmoid.configuration.lengthExtMargin / 100
property int lengthAppletIntMargin: lengthAppletIntMarginFactor === -1 ? lengthIntMargin : lengthAppletIntMarginFactor * root.iconSize
property real lengthAppletIntMarginFactor: indicators.infoLoaded && !parabolicEffectEnabled ? indicators.info.appletLengthPadding : -1
property real lengthAppletIntMarginFactor: indicators.infoLoaded ? indicators.info.appletLengthPadding : -1
property real thickMarginFactor: {
if (shrinkThickMargins) {
@ -407,15 +406,9 @@ Item {
property int lengthMargin: lengthIntMargin + lengthExtMargin
property int lengthMargins: 2 * lengthMargin
property int lengthAppletMargin: lengthAppletIntMargin + lengthExtMargin
property int lengthAppletMargins: 2 * lengthAppletIntMargin
property int widthMargins: root.isVertical ? thickMargins : lengthMargins
property int heightMargins: root.isHorizontal ? thickMargins : lengthMargins
property int internalWidthMargins: root.isVertical ? thickMargins : 2 * lengthAppletMargin
property int internalHeightMargins: root.isHorizontal ? thickMargins : 2 * lengthAppletMargin
///FIXME: <delete both> I can't remember why this is needed, maybe for the anchorings!!! In order for the Double Layout to not mess the anchorings...
//property int layoutsContainer.mainLayoutPosition: !plasmoid.immutable ? Latte.Types.Center : (root.isVertical ? Latte.Types.Top : Latte.Types.Left)
//property int panelAlignment: plasmoid.configuration.panelPosition !== Latte.Types.Justify ? plasmoid.configuration.panelPosition : layoutsContainer.mainLayoutPosition
@ -619,13 +612,6 @@ Item {
}
}
Behavior on lengthAppletIntMargin {
NumberAnimation {
duration: 0.8 * root.animationTime
easing.type: Easing.OutCubic
}
}
Behavior on lengthExtMargin {
NumberAnimation {
duration: 0.8 * root.animationTime

@ -68,7 +68,7 @@ Item{
readonly property color backgroundColor: iconImageBuffer.backgroundColor
readonly property color glowColor: iconImageBuffer.glowColor
readonly property bool progressVisible: smartLauncherItem && smartLauncherItem.progressVisible
readonly property real progress: smartLauncherItem && smartLauncherItem.progress
readonly property real progress: smartLauncherItem && smartLauncherItem.progress ? smartLauncherItem.progress : 0
property QtObject buffers: null
property QtObject smartLauncherItem: null

Loading…
Cancel
Save