1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-01-23 22:03:54 +03:00

split thickness margins to tail and head

--make head thickness margin and tail thickness
margin totally independent
--ability item: reanchor it based on the screen edge
like applets are already doing
--adjust tasks animations in order to take into
account the anchoring
--parabolic effect adjust calculations to use
new thickness margins
This commit is contained in:
Michail Vourlakos 2022-01-30 02:35:04 +02:00
parent f0ad7b23c7
commit 097ceed7d2
28 changed files with 185 additions and 124 deletions

View File

@ -24,8 +24,10 @@ Ability.MetricsPrivate {
//! Margin
margin.length: fraction.lengthMargin * iconSize
margin.thickness: marginMinThickness + fraction.thicknessMargin * Math.max(0, _iconSize - marginMinThickness)
margin.maxThickness: marginMinThickness + fraction.thicknessMargin * Math.max(0, _maxIconSize - marginMinThickness)
margin.tailThickness: marginMinThickness + fraction.thicknessMargin * Math.max(0, _iconSize - marginMinThickness)
margin.maxTailThickness: marginMinThickness + fraction.thicknessMargin * Math.max(0, _maxIconSize - marginMinThickness)
margin.headThickness: margin.tailThickness
margin.maxHeadThickness: margin.maxTailThickness
//margin.thickness: fraction.thicknessMargin * iconSize
// margin.maxThickness: fraction.thicknessMargin * maxIconSize
margin.screenEdge: (root.screenEdgeMarginEnabled && root.behaveAsPlasmaPanel)
@ -34,22 +36,24 @@ Ability.MetricsPrivate {
0 : plasmoid.configuration.screenEdgeMargin
//! MarginsAra
marginsArea.marginThickness: {
marginsArea.headThickness: {
if (!themeExtended) {
return metrics.margin.thickness;
return metrics.margin.headThickness;
}
if (plasmoid.location === PlasmaCore.Types.TopEdge) {
return themeExtended.marginsAreaBottom + metrics.margin.thickness;
return themeExtended.marginsAreaBottom + metrics.margin.headThickness;
} else if (plasmoid.location === PlasmaCore.Types.LeftEdge) {
return themeExtended.marginsAreaRight + metrics.margin.thickness;
return themeExtended.marginsAreaRight + metrics.margin.headThickness;
} else if (plasmoid.location === PlasmaCore.Types.RightEdge) {
return themeExtended.marginsAreaLeft + metrics.margin.thickness;
return themeExtended.marginsAreaLeft + metrics.margin.headThickness;
}
return themeExtended.marginsAreaTop + metrics.margin.thickness;
return themeExtended.marginsAreaTop + metrics.margin.headThickness;
}
marginsArea.tailThickness: marginsArea.headThickness
//! Mask
mask.maxScreenEdge : root.behaveAsDockWithMask ? Math.max(0, plasmoid.configuration.screenEdgeMargin) : 0
// window geometry is updated after the local screen margin animation was zeroed*/
@ -57,18 +61,18 @@ Ability.MetricsPrivate {
mask.thickness.hidden: LatteCore.WindowSystem.compositingActive ? 2 : 1
mask.thickness.normal: mask.screenEdge + Math.max(totals.thickness + extraThicknessForNormal, background.thickness + background.shadows.headThickness)
mask.thickness.medium: mask.screenEdge + (1 + (0.65 * (parabolic.factor.maxZoom-1)))*(totals.thickness+extraThicknessForZoomed)
mask.thickness.zoomed: mask.screenEdge + ((totals.thickness+extraThicknessForZoomed) * parabolic.factor.maxZoom) + 2
mask.thickness.maxNormal: mask.maxScreenEdge + maxIconSize + (margin.maxThickness * 2) + extraThicknessForNormal
mask.thickness.maxMedium: mask.maxScreenEdge + Math.max(mask.thickness.maxNormalForItems, extraThicknessForNormal + (1 + (0.65 * (parabolic.factor.maxZoom-1)))*(maxIconSize+margin.maxThickness))
mask.thickness.maxZoomed: mask.maxScreenEdge + Math.max( ((maxIconSize+(margin.maxThickness * 2)) * parabolic.factor.maxZoom) + extraThicknessForZoomed,
mask.thickness.medium: mask.screenEdge + mediumFactor*(iconSize+extraThicknessForZoomed) + mediumMarginsFactor*totals.thicknessEdges
mask.thickness.zoomed: mask.screenEdge + ((iconSize+extraThicknessForZoomed) * parabolic.factor.maxZoom) + maxMarginsFactor*totals.thicknessEdges + 2
mask.thickness.maxNormal: mask.maxScreenEdge + maxIconSize + (margin.maxTailThickness + margin.maxHeadThickness) + extraThicknessForNormal
mask.thickness.maxMedium: mask.maxScreenEdge + Math.max(mask.thickness.maxNormalForItems, extraThicknessForNormal + (mediumFactor*maxIconSize)+(mediumMarginsFactor*margin.tailThickness))
mask.thickness.maxZoomed: mask.maxScreenEdge + Math.max( ((maxIconSize*parabolic.factor.maxZoom) + ((margin.maxTailThickness + margin.maxHeadThickness)*maxMarginsFactor)) + extraThicknessForZoomed,
background.thickness + background.shadows.headThickness)
mask.thickness.normalForItems: margin.screenEdge + totals.thickness
mask.thickness.zoomedForItems: margin.screenEdge + (parabolic.factor.zoom * totals.thickness)
mask.thickness.zoomedForItems: margin.screenEdge + (parabolic.factor.zoom * iconSize) + (parabolic.factor.marginThicknessZoom * totals.thicknessEdges)
mask.thickness.maxNormalForItemsWithoutScreenEdge: maxIconSize + (margin.maxThickness * 2)
mask.thickness.maxZoomedForItemsWithoutScreenEdge: (maxIconSize + (margin.maxThickness * 2)) * parabolic.factor.maxZoom
mask.thickness.maxNormalForItemsWithoutScreenEdge: maxIconSize + margin.maxTailThickness + margin.maxHeadThickness
mask.thickness.maxZoomedForItemsWithoutScreenEdge: maxIconSize*parabolic.factor.maxZoom + (margin.maxTailThickness + margin.maxHeadThickness)*maxMarginsFactor
mask.thickness.maxNormalForItems: mask.maxScreenEdge + mask.thickness.maxNormalForItemsWithoutScreenEdge
mask.thickness.maxZoomedForItems: mask.maxScreenEdge + mask.thickness.maxZoomedForItemsWithoutScreenEdge

View File

@ -24,6 +24,7 @@ Ability.ParabolicEffectPrivate {
return (maxSize/metrics.iconSize);
}
factor.maxZoom: Math.max(factor.zoom, animations.requirements.zoomFactor)
factor.marginThicknessZoomInPercentage: 1.0 //100%
restoreZoomIsBlocked: restoreZoomIsBlockedFromApplet || (view && view.contextMenuIsShown)
spread: settings ? settings.parabolicSpread : 3

View File

@ -74,8 +74,8 @@ AbilityHost.Metrics {
shadowMaxNeededMargin = (shadowMaxNeededMargin * shadowOpacity);
//! give some more space when items shadows are enabled and extremely big
if (root.myView.itemShadow.isEnabled && metrics.margin.maxThickness < shadowMaxNeededMargin) {
return shadowMaxNeededMargin - metrics.margin.maxThickness;
if (root.myView.itemShadow.isEnabled && metrics.margin.maxHeadThickness < shadowMaxNeededMargin) {
return shadowMaxNeededMargin - metrics.margin.maxHeadThickness;
}
return 0;
@ -83,6 +83,9 @@ AbilityHost.Metrics {
readonly property int extraThicknessFromIndicators: indicators.info.extraMaskThickness
readonly property real mediumFactor: (1 + (0.65 * (parabolic.factor.maxZoom-1)))
readonly property real mediumMarginsFactor: 1 + ((mediumFactor-1) * parabolic.factor.marginThicknessZoomInPercentage)
readonly property real maxMarginsFactor: 1 + ((parabolic.factor.maxZoom-1) * parabolic.factor.marginThicknessZoomInPercentage)
//! BEHAVIORS
Behavior on iconSize {
@ -113,7 +116,14 @@ AbilityHost.Metrics {
}
}
Behavior on thickness {
Behavior on tailThickness {
NumberAnimation {
duration: 0.8 * animations.duration.proposed
easing.type: Easing.OutCubic
}
}
Behavior on headThickness {
NumberAnimation {
duration: 0.8 * animations.duration.proposed
easing.type: Easing.OutCubic

View File

@ -833,10 +833,12 @@ Item {
readonly property int badgeThickness: {
if (plasmoid.location === PlasmaCore.Types.BottomEdge
|| plasmoid.location === PlasmaCore.Types.RightEdge) {
return ((appletItem.metrics.iconSize + appletItem.metrics.margin.thickness) * wrapper.zoomScale) + appletItem.metrics.margin.screenEdge;
var marginthickness = appletItem.metrics.margin.tailThickness * wrapper.zoomMarginScale;
return (appletItem.metrics.iconSize * wrapper.zoomScale) + marginthickness + appletItem.metrics.margin.screenEdge;
}
return ((appletItem.metrics.iconSize + appletItem.metrics.margin.thickness) * wrapper.zoomScale);
var marginthickness = appletItem.metrics.margin.headThickness * wrapper.zoomMarginScale;
return (appletItem.metrics.iconSize * wrapper.zoomScale) + marginthickness;
}
ShortcutBadge{

View File

@ -11,8 +11,8 @@ import org.kde.latte.core 0.2 as LatteCore
Item {
property Item destination: null
readonly property int headThickness: destination ? destination.headThicknessMargin : appletItem.metrics.margin.thickness
readonly property int tailThickness: destination ? destination.tailThicknessMargin : appletItem.metrics.margin.thickness
readonly property int headThickness: destination ? destination.headThicknessMargin : appletItem.metrics.margin.headThickness
readonly property int tailThickness: destination ? destination.tailThicknessMargin : appletItem.metrics.margin.tailThickness
readonly property int thickness: headThickness + tailThickness + (root.isHorizontal ? destination.height : destination.width)
readonly property int lengthPadding: {
if ( (root.myView.alignment === LatteCore.Types.Justify && appletItem.firstChildOfStartLayout)

View File

@ -140,7 +140,7 @@ Item{
? 0 : appletItem.lengthAppletFullMargins
property real scaledLength: zoomScaleLength * (layoutLength + marginsLength)
property real scaledThickness: zoomScaleThickness * (layoutThickness + marginsThickness)
property real scaledThickness: zoomScaleThickness * layoutThickness + (zoomMarginScale*marginsThickness)
property real zoomScaleLength: disableLengthScale ? 1 : zoomScale
property real zoomScaleThickness: disableThicknessScale ? 1 : zoomScale
@ -149,6 +149,7 @@ Item{
property real layoutThickness: 0
property real zoomScale: 1
readonly property real zoomMarginScale: 1 + (zoomScale - 1) * parabolic.factor.marginThicknessZoomInPercentage
readonly property alias headThicknessMargin: _wrapperContainer.headThicknessMargin
readonly property alias tailThicknessMargin: _wrapperContainer.tailThicknessMargin
@ -458,20 +459,20 @@ Item{
} else if (appletItem.canFillThickness) {
return appliedEdgeMargin;
} else if (appletItem.inMarginsArea) {
return appliedEdgeMargin + (wrapper.zoomScaleThickness * appletItem.metrics.marginsArea.marginThickness);
return appliedEdgeMargin + (wrapper.zoomMarginScale * appletItem.metrics.marginsArea.tailThickness);
}
return appliedEdgeMargin + (wrapper.zoomScaleThickness * appletItem.metrics.margin.thickness);
return appliedEdgeMargin + (wrapper.zoomMarginScale * appletItem.metrics.margin.tailThickness);
}
readonly property int headThicknessMargin: {
if (appletItem.canFillThickness || appletItem.canFillScreenEdge) {
return 0;
} else if (appletItem.inMarginsArea) {
return (wrapper.zoomScaleThickness * appletItem.metrics.marginsArea.marginThickness);
return (wrapper.zoomMarginScale * appletItem.metrics.marginsArea.headThickness);
}
return (wrapper.zoomScaleThickness * appletItem.metrics.margin.thickness);
return wrapper.zoomMarginScale * appletItem.metrics.margin.headThickness;
}
readonly property real zoomScaleThickness: wrapper.zoomScaleThickness

View File

@ -11,23 +11,37 @@ import org.kde.plasma.core 2.0 as PlasmaCore
Item {
id: paddingsVisual
readonly property int thickness: {
readonly property int headThickness: {
if ((appletItem.canFillThickness && !appletItem.isMarginsAreaSeparator && !communicator.indexerIsSupported)
|| (appletItem.canFillScreenEdge && !communicator.indexerIsSupported) ) {
return 1;
} else if (appletItem.isMarginsAreaSeparator) {
return appletItem.metrics.marginsArea.marginThickness + maxMarginAreaSeparatorGap;
return appletItem.metrics.marginsArea.headThickness + maxMarginAreaSeparatorGap;
} else if (appletItem.inMarginsArea) {
return appletItem.metrics.marginsArea.marginThickness;
return appletItem.metrics.marginsArea.headThickness;
}
return appletItem.metrics.margin.thickness;
return appletItem.metrics.margin.headThickness;
}
readonly property int tailThickness: {
if ((appletItem.canFillThickness && !appletItem.isMarginsAreaSeparator && !communicator.indexerIsSupported)
|| (appletItem.canFillScreenEdge && !communicator.indexerIsSupported) ) {
return 1;
} else if (appletItem.isMarginsAreaSeparator) {
return appletItem.metrics.marginsArea.tailThickness + maxMarginAreaSeparatorGap;
} else if (appletItem.inMarginsArea) {
return appletItem.metrics.marginsArea.tailThickness;
}
return appletItem.metrics.margin.tailThickness;
}
readonly property int length: root.isHorizontal ? wrapper.width : wrapper.height
readonly property int parentThickness: root.isHorizontal ? wrapper.height : wrapper.width
readonly property int maxMarginAreaSeparatorCenteredRectLength: Math.max(0.6 * paddingsVisual.length, 4)
readonly property int marginAreaSeparatorFreeThickness: ((parentThickness - 2*appletItem.metrics.marginsArea.marginThickness - maxMarginAreaSeparatorCenteredRectLength - 10) / 2)
readonly property int marginAreaSeparatorFreeThickness: ((parentThickness - appletItem.metrics.marginsArea.headThickness - appletItem.metrics.marginsArea.tailThickness - maxMarginAreaSeparatorCenteredRectLength - 10) / 2)
readonly property int maxMarginAreaSeparatorGap: Math.max(3, 0.5 * marginAreaSeparatorFreeThickness)
property color color: "blue"
@ -39,8 +53,8 @@ Item {
anchors.bottomMargin: plasmoid.location === PlasmaCore.Types.BottomEdge ? appletItem.metrics.margin.screenEdge : 0
anchors.rightMargin: plasmoid.location === PlasmaCore.Types.RightEdge ? appletItem.metrics.margin.screenEdge : 0
width: root.isHorizontal ? length : thickness
height: root.isHorizontal ? thickness : length
width: root.isHorizontal ? length : tailThickness
height: root.isHorizontal ? tailThickness : length
color: parent.color
@ -95,11 +109,11 @@ Item {
anchors.bottomMargin: plasmoid.location === PlasmaCore.Types.BottomEdge ? normalMargin : 0
anchors.rightMargin: plasmoid.location === PlasmaCore.Types.RightEdge ? normalMargin : 0
width: root.isHorizontal ? length : thickness
height: root.isHorizontal ? thickness : length
width: root.isHorizontal ? length : headThickness
height: root.isHorizontal ? headThickness : length
color: parent.color
readonly property int normalMargin: appletItem.metrics.mask.thickness.normalForItems - thickness
readonly property int normalMargin: appletItem.metrics.mask.thickness.normalForItems - headThickness
states:[
State{

View File

@ -20,7 +20,7 @@ Item{
property int size: 1
property int thickness: Math.min(Math.max(minimumThickness, preferredThickness), maximumThickness)
property int minimumThickness: 0
readonly property int preferredThickness: (parabolic.factor.zoom * metrics.totals.thickness) + metrics.margin.screenEdge
readonly property int preferredThickness: (parabolic.factor.zoom * metrics.iconSize) + (parabolic.factor.marginThicknessZoom * metrics.totals.thicknessEdges) + metrics.margin.screenEdge
property int maximumThickness: 9999
property Item metrics: null

View File

@ -91,7 +91,7 @@ Item{
// USE CASE: it can be used from applets that want to be informed what is the thickness padding
// currently applied
// @since: 0.10
readonly property int thicknessPadding: appletItem.metrics.margin.thickness
readonly property int thicknessPadding: appletItem.metrics.margin.tailThickness
// NAME: lengthMargin
// USAGE: read-only

View File

@ -235,7 +235,7 @@ BackgroundProperties{
property int animationTime: 6*animations.speedFactor.current*animations.duration.small
//! Metrics related
readonly property bool isGreaterThanItemThickness: root.useThemePanel && (totals.visualThickness >= (metrics.iconSize + metrics.margin.thickness))
readonly property bool isGreaterThanItemThickness: root.useThemePanel && (totals.visualThickness >= (metrics.iconSize + metrics.margin.tailThickness))
//! CustomShadowedRectangle properties
readonly property bool customShadowedRectangleIsEnabled: customRadiusIsEnabled || (customDefShadowIsEnabled || customUserShadowIsEnabled)

View File

@ -482,11 +482,19 @@ Window{
}
Text{
text: "Thickness Margin"+space
text: "Head Thickness Margin"+space
}
Text{
text: metrics.margin.thickness
text: metrics.margin.headThickness
}
Text{
text: "Tail Thickness Margin"+space
}
Text{
text: metrics.margin.tailThickness
}
Text{

View File

@ -858,7 +858,7 @@ Item {
width: root.isHorizontal ? parent.length : parent.thickness - metrics.margin.screenEdge
height: root.isHorizontal ? parent.thickness - metrics.margin.screenEdge : parent.length
property int thickMargin: metrics.margin.screenEdge //+ metrics.margin.thickness
property int thickMargin: metrics.margin.screenEdge
LatteComponents.AddItem{
id: dndSpacerAddItem

View File

@ -14,14 +14,17 @@ Item {
property int backgroundThickness: 16
property MetricsTypes.Margin margin: MetricsTypes.Margin{
thickness: 4
maxThickness: 4
tailThickness: 4
maxTailThickness: 4
headThickness: 4
maxHeadThickness: 4
length: 4
screenEdge: 0
}
property MetricsTypes.MarginsArea marginsArea: MetricsTypes.MarginsArea{
marginThickness: 8 //margin.thickness + 4
tailThickness: 8 //margin.thickness + 4
headThickness: 8 //margin.thickness + 4
//readonly property int iconSize: _metrics.totals.thickness - thicknessEdges
//readonly property int thicknessEdges: 2*marginThickness
}

View File

@ -19,6 +19,7 @@ Item {
property ParabolicEffectTypes.Factor factor: ParabolicEffectTypes.Factor{
zoom: 1.6
maxZoom: 1.6
marginThicknessZoomInPercentage: 1.0
}
readonly property ParabolicEffectTypes.PrivateProperties _privates: ParabolicEffectTypes.PrivateProperties {

View File

@ -6,8 +6,10 @@
import QtQuick 2.0
Item {
property int thickness: 4
property int maxThickness: 4
property int tailThickness: 4
property int maxTailThickness: 4
property int headThickness: 4
property int maxHeadThickness: 4
property int length: 4
property int screenEdge: 0
}

View File

@ -6,7 +6,8 @@
import QtQuick 2.0
Item {
property int marginThickness: 8
property int headThickness: 8
property int tailThickness: 8
readonly property int iconSize: _metrics.totals.thickness - thicknessEdges
readonly property int thicknessEdges: 2*marginThickness
readonly property int thicknessEdges: headThickness + tailThickness
}

View File

@ -11,5 +11,5 @@ Item {
readonly property int lengthEdges: 2 * lengthEdge
readonly property int lengthPaddings: 2 * padding.length
readonly property int thickness: iconSize + thicknessEdges
readonly property int thicknessEdges: 2 * margin.thickness
readonly property int thicknessEdges: margin.tailThickness + margin.headThickness
}

View File

@ -8,4 +8,7 @@ import QtQuick 2.7
Item {
property real zoom: 1.6
property real maxZoom: 1.6
readonly property real marginThicknessZoom: 1.0 + ((zoom-1.0) * marginThicknessZoomInPercentage)
property real marginThicknessZoomInPercentage: 1.0 //100&
}

View File

@ -123,8 +123,10 @@ Item{
readonly property int itemIndex: index
readonly property int animationTime: (abilityItem.abilities.animations.active ? abilityItem.abilities.animations.speedFactor.current : 2) * (1.2 * abilityItem.abilities.animations.duration.small)
readonly property int iconOffsetX: indicatorBackLayer.level.requested.iconOffsetX
readonly property int iconOffsetY: indicatorBackLayer.level.requested.iconOffsetY
property int iconAnimatedOffsetX: 0
property int iconAnimatedOffsetY: 0
readonly property int iconOffsetX: iconAnimatedOffsetX + indicatorBackLayer.level.requested.iconOffsetX
readonly property int iconOffsetY: iconAnimatedOffsetY + indicatorBackLayer.level.requested.iconOffsetY
readonly property int iconTransformOrigin: indicatorBackLayer.level.requested.iconTransformOrigin
readonly property real iconOpacity: indicatorBackLayer.level.requested.iconOpacity
readonly property real iconRotation: indicatorBackLayer.level.requested.iconRotation

View File

@ -38,17 +38,21 @@ Item{
property real scaleLength: hasZoomPerAxis ? zoomLength : zoom
property real scaleThickness: hasZoomPerAxis ? zoomThickness : zoom
readonly property real marginZoom: 1 + ((zoom-1) * abilityItem.abilities.parabolic.factor.marginThicknessZoomInPercentage)
readonly property real marginScaleThickness: 1 + ((scaleThickness-1) * abilityItem.abilities.parabolic.factor.marginThicknessZoomInPercentage)
property real cleanScalingLength: abilityItem.abilities.metrics.totals.length * zoom
property real cleanScalingThickness: abilityItem.abilities.metrics.totals.thickness * zoom
property real cleanScalingThickness: (abilityItem.abilities.metrics.iconSize * zoom) + (abilityItem.abilities.metrics.totals.thicknessEdges * marginZoom)
property real basicScalingLength: hasZoomPerAxis ? abilityItem.abilities.metrics.totals.length * scaleLength : cleanScalingLength
property real basicScalingThickness: hasZoomPerAxis ? abilityItem.abilities.metrics.totals.thickness * scaleThickness : cleanScalingThickness
property real basicScalingThickness: hasZoomPerAxis ? (abilityItem.abilities.metrics.iconSize * scaleThickness) + (abilityItem.abilities.metrics.totals.thicknessEdges * marginScaleThickness) :
cleanScalingThickness
property real regulatorLength: abilityItem.isSeparator ? (abilityItem.isHorizontal ? width : height) : basicScalingLength
property real regulatorThickness: abilityItem.isSeparator ? (abilityItem.isHorizontal ? height : width) : basicScalingThickness
property real visualScaledLength: (abilityItem.abilities.metrics.iconSize + abilityItem.abilities.metrics.totals.lengthPaddings) * zoom
property real visualScaledThickness: abilityItem.abilities.metrics.totals.thickness * zoom
property real visualScaledThickness: cleanScalingThickness
/// end of Scalers///////
readonly property alias contentItemContainer: _contentItemContainer
@ -95,7 +99,7 @@ Item{
TitleTooltipParent{
id: _titleTooltipVisualParent
thickness: abilityItem.abilities.parabolic.factor.zoom * abilityItem.abilities.metrics.totals.thickness
thickness: abilityItem.abilities.metrics.mask.thickness.zoomedForItems - abilityItem.abilities.metrics.margin.screenEdge
}
//fix bug #478, when changing form factor sometimes the tasks are not positioned
@ -138,9 +142,22 @@ Item{
//! Main contented item
Item {
id: _contentItemContainer
anchors.centerIn: parent
anchors.horizontalCenterOffset: abilityItem.iconOffsetX
anchors.verticalCenterOffset: abilityItem.iconOffsetY
anchors.bottom: (abilityItem.location === PlasmaCore.Types.BottomEdge) ? parent.bottom : undefined
anchors.top: (abilityItem.location === PlasmaCore.Types.TopEdge) ? parent.top : undefined
anchors.left: (abilityItem.location === PlasmaCore.Types.LeftEdge) ? parent.left : undefined
anchors.right: (abilityItem.location === PlasmaCore.Types.RightEdge) ? parent.right : undefined
anchors.horizontalCenter: abilityItem.isHorizontal ? parent.horizontalCenter : undefined
anchors.verticalCenter: abilityItem.isHorizontal ? undefined : parent.verticalCenter
anchors.bottomMargin: (abilityItem.location === PlasmaCore.Types.BottomEdge) ? tailMargin + abilityItem.iconOffsetY : 0
anchors.topMargin: (abilityItem.location === PlasmaCore.Types.TopEdge) ? tailMargin + abilityItem.iconOffsetY : 0
anchors.leftMargin: (abilityItem.location === PlasmaCore.Types.LeftEdge) ? tailMargin + abilityItem.iconOffsetX : 0
anchors.rightMargin: (abilityItem.location === PlasmaCore.Types.RightEdge) ? tailMargin + abilityItem.iconOffsetX : 0
anchors.horizontalCenterOffset: abilityItem.isHorizontal ? abilityItem.iconOffsetX : 0
anchors.verticalCenterOffset: abilityItem.isVertical ? abilityItem.iconOffsetY : 0
transformOrigin: abilityItem.iconTransformOrigin
opacity: abilityItem.iconOpacity
rotation: abilityItem.iconRotation
@ -152,12 +169,18 @@ Item{
property int zoomedSize: abilityItem.abilities.parabolic.factor.zoom * abilityItem.abilities.metrics.iconSize
property real basicScalingLength: abilityItem.abilities.metrics.iconSize * (parabolicItem.hasZoomPerAxis ? parabolicItem.scaleLength : parabolicItem.zoom)
property real basicScalingThickness: proposedItemThickness * (parabolicItem.hasZoomPerAxis ? parabolicItem.scaleThickness : parabolicItem.zoom)
property real basicScalingThickness: proposedItemThickness * appliedZoom
readonly property real appliedZoom: (parabolicItem.hasZoomPerAxis ? parabolicItem.scaleThickness : parabolicItem.zoom)
readonly property real marginAppliedZoom: 1 + ((appliedZoom-1) * abilityItem.abilities.parabolic.factor.marginThicknessZoomInPercentage)
readonly property int proposedItemThickness: abilityItem.abilities.indexer.inMarginsArea ?
Math.max(16, abilityItem.abilities.metrics.marginsArea.iconSize) :
abilityItem.abilities.metrics.iconSize
readonly property int itemNormalTailMargin: abilityItem.abilities.indexer.inMarginsArea ? abilityItem.abilities.metrics.marginsArea.tailThickness : abilityItem.abilities.metrics.margin.tailThickness
readonly property real tailMargin: Math.round(itemNormalTailMargin * marginAppliedZoom)
property real newTempSize: {
if (parabolicItem.opacity === 1 ) {
return Math.min(basicScalingLength, basicScalingThickness);
@ -203,6 +226,18 @@ Item{
width: abilityItem.abilities.metrics.iconSize * (parabolicItem.hasZoomPerAxis ? parabolicItem.scaleThickness : parabolicItem.zoom)
height: width
}
Loader{
anchors.fill: _contentItemContainer
active: abilityItem.abilities.debug.graphicsEnabled
sourceComponent: Rectangle{
anchors.fill: parent
color: "transparent"
border.color: "yellow"
border.width: 1
}
}
}
function sendEndOfNeedBothAxisAnimation(){

View File

@ -34,7 +34,7 @@ Loader {
opacity: 0.4
readonly property int margin: abilityItem.abilities.metrics.margin.screenEdge + abilityItem.abilities.metrics.margin.thickness
readonly property int margin: abilityItem.abilities.metrics.margin.screenEdge + abilityItem.abilities.metrics.margin.tailThickness
active: abilityItem.isSeparatorVisible

View File

@ -716,10 +716,11 @@ Item {
launchers.isStealingDroppedLaunchers: plasmoid.configuration.isPreferredForDroppedLaunchers
launchers.syncer.isBlocked: inDraggingPhase
metrics.local.iconSize: inPlasmaDesktop ? maxIconSizeInPlasma : (inPlasmaPanel ? Math.max(16, panelThickness - 2*metrics.margin.thickness) : maxIconSizeInPlasma)
metrics.local.iconSize: inPlasmaDesktop ? maxIconSizeInPlasma : (inPlasmaPanel ? Math.max(16, panelThickness - metrics.margin.tailThickness - metrics.margin.headThickness) : maxIconSizeInPlasma)
metrics.local.backgroundThickness: metrics.totals.thickness
metrics.local.margin.length: 0.1 * metrics.iconSize
metrics.local.margin.thickness: inPlasmaDesktop ? 0.16 * metrics.iconSize : Math.max(2, (panelThickness - maxIconSizeInPlasma) / 2)
metrics.local.margin.tailThickness: inPlasmaDesktop ? 0.16 * metrics.iconSize : Math.max(2, (panelThickness - maxIconSizeInPlasma) / 2)
metrics.local.margin.headThickness: metrics.local.margin.tailThickness
metrics.local.padding.length: 0.04 * metrics.iconSize
myView.local.isHidingBlocked: root.contextMenu || root.windowPreviewIsShown

View File

@ -83,9 +83,6 @@ Item{
}
}
}
taskItem.parabolicItem.zoomLength = taskItem.parabolicItem.zoom;
taskItem.parabolicItem.zoomThickness = taskItem.parabolicItem.zoom;
}
function startLauncherAnimation(){

View File

@ -50,10 +50,6 @@ Item{
function clear(){
newWindowAnimationLoader.item.stop();
taskItem.parabolicItem.zoomLength = 1.0;
taskItem.parabolicItem.zoomThickness = 1.0;
taskItem.setBlockingAnimation(false);
taskItem.inAttentionBuiltinAnimation = false;
taskItem.inNewWindowBuiltinAnimation = false;
@ -80,12 +76,7 @@ Item{
function init(){
taskItem.setBlockingAnimation(true);
taskItem.inNewWindowBuiltinAnimation = true;
taskItem.parabolicItem.zoomLength = taskItem.parabolicItem.zoom;
taskItem.parabolicItem.zoomThickness = taskItem.parabolicItem.zoom;
taskItem.inAttentionBuiltinAnimation = isDemandingAttention;
taskItem.abilities.animations.needThickness.addEvent(needThicknessEvent);
}

View File

@ -158,9 +158,9 @@ SequentialAnimation {
}
PropertyAnimation {
target: taskItem.parabolicItem
property: "zoomThickness"
to: 0
target: taskItem
property: taskItem.isVertical ? "iconAnimatedOffsetX" : "iconAnimatedOffsetY"
to: -0.7*taskItem.abilities.metrics.iconSize
duration: taskRealRemovalAnimation.enabledAnimation ? 1.35*showWindowAnimation.speed : 0
easing.type: Easing.InQuad
}

View File

@ -65,6 +65,15 @@ SequentialAnimation{
duration: showWindowAnimation.speed
easing.type: Easing.OutQuad
}
PropertyAnimation {
target: taskItem
property: taskItem.isVertical ? "iconAnimatedOffsetX" : "iconAnimatedOffsetY"
from: -taskItem.abilities.metrics.iconSize
to: 0
duration: showWindowAnimation.speed
easing.type: Easing.OutQuad
}
}
onStopped: {

View File

@ -8,6 +8,8 @@ import QtQuick 2.0
import org.kde.plasma.plasmoid 2.0
SequentialAnimation{
readonly property string bouncePropertyName: taskItem.isVertical ? "iconAnimatedOffsetX" : "iconAnimatedOffsetY"
//Ghost animation that acts as a delayer
PropertyAnimation {
target: taskItem.parabolicItem
@ -18,47 +20,29 @@ SequentialAnimation{
}
//end of ghost animation
ParallelAnimation{
PropertyAnimation {
target: taskItem.parabolicItem
property: "zoomThickness"
to: taskItem.containsMouse ? 1+2*(taskItem.abilities.parabolic.factor.maxZoom-1) : 1 + (1.5 * (taskItem.abilities.parabolic.factor.maxZoom-1))
duration: launcherAnimation.speed
easing.type: Easing.OutQuad
}
PropertyAnimation {
target: taskItem.parabolicItem
property: "zoomLength"
to: 1
duration: launcherAnimation.speed
easing.type: Easing.OutQuad
}
}
PropertyAnimation {
target: taskItem.parabolicItem
property: "zoomThickness"
to: 1
duration: 4*launcherAnimation.speed
easing.type: Easing.OutBounce
}
ParallelAnimation{
PropertyAnimation {
target: taskItem.parabolicItem
property: "zoomLength"
to: 1
duration: 0.5 * taskItem.abilities.animations.speedFactor.current*launcherAnimation.speed
easing.type: Easing.OutBounce
}
ParallelAnimation {
PropertyAnimation {
target: taskItem.parabolicItem
property: "zoom"
to: 1
duration: 0.5 * taskItem.abilities.animations.speedFactor.current*launcherAnimation.speed
duration: launcherAnimation.speed
easing.type: Easing.OutQuad
}
PropertyAnimation {
target: taskItem
property: bouncePropertyName
to: taskItem.abilities.metrics.iconSize
duration: launcherAnimation.speed
easing.type: Easing.OutQuad
}
}
PropertyAnimation {
target: taskItem
property: bouncePropertyName
to: 0
duration: 4*launcherAnimation.speed
easing.type: Easing.OutBounce
}
}

View File

@ -11,6 +11,8 @@ SequentialAnimation{
alwaysRunToEnd: true
loops: newWindowAnimation.isDemandingAttention ? 20 : 1
readonly property string bouncePropertyName: taskItem.isVertical ? "iconAnimatedOffsetX" : "iconAnimatedOffsetY"
Component.onCompleted: {
if (newWindowAnimation.inDelayedStartup) {
newWindowAnimation.inDelayedStartup = false;
@ -19,30 +21,20 @@ SequentialAnimation{
}
}
ParallelAnimation{
ParallelAnimation {
PropertyAnimation {
target: taskItem.parabolicItem
property: "zoomThickness"
to: 1 + (thickPercentage * 2 * (taskItem.abilities.animations.requirements.zoomFactor-1))
duration: newWindowAnimation.speed
easing.type: Easing.OutQuad
property real thickPercentage: taskItem.inAttentionBuiltinAnimation ? 0.8 : 0.6
}
PropertyAnimation {
target: taskItem.parabolicItem
property: "zoomLength"
to: 1
target: taskItem
property: bouncePropertyName
to: 0.6 * taskItem.abilities.metrics.iconSize
duration: newWindowAnimation.speed
easing.type: Easing.OutQuad
}
}
PropertyAnimation {
target: taskItem.parabolicItem
property: "zoomThickness"
to: 1
target: taskItem
property: bouncePropertyName
to: 0
duration: 4.4*newWindowAnimation.speed
easing.type: Easing.OutBounce
}