1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-26 23:21:37 +03:00

fix attention animation with new indicators

This commit is contained in:
Michail Vourlakos 2019-02-22 20:25:51 +02:00
parent 388a5cdb99
commit e40e1556a9
4 changed files with 33 additions and 80 deletions

View File

@ -53,10 +53,7 @@ MouseArea{
return root.vertical ? separatorItem.width : (root.dragSource || root.editMode ? 5+root.lengthMargins : 0);
if (root.vertical) {
if (!inAttentionAnimation)
return wrapper.width;
else
return wrapper.maxThickness;
return wrapper.width;
} else {
return hiddenSpacerLeft.width+wrapper.width+hiddenSpacerRight.width;
}
@ -76,10 +73,7 @@ MouseArea{
if (root.vertical) {
return hiddenSpacerLeft.height + wrapper.height + hiddenSpacerRight.height;
} else {
if (!inAttentionAnimation)
return wrapper.height;
else
return wrapper.maxThickness;
return wrapper.height;
}
}
@ -105,6 +99,7 @@ MouseArea{
property bool inBouncingAnimation: false
property bool inFastRestoreAnimation: false
property bool inMimicParabolicAnimation: false
property bool inNewWindowAnimation: false
property real mimicParabolicScale: -1
property bool inPopup: false
property bool inRemoveStage: false
@ -446,11 +441,29 @@ MouseArea{
anchors.horizontalCenter: !root.vertical ? parent.horizontalCenter : undefined
anchors.verticalCenter: root.vertical ? parent.verticalCenter : undefined
width: !root.vertical ? wrapper.width - 2*wrapper.mScale*root.lengthExtMargin : wrapper.width
height: root.vertical ? wrapper.height - 2*wrapper.mScale*root.lengthExtMargin : wrapper.height
width: {
if (locked) {
return visualLockedWidth;
}
return !root.vertical ? wrapper.width - 2*wrapper.mScale*root.lengthExtMargin : wrapper.width;
}
height: {
if (locked) {
return visualLockedHeight;
}
return root.vertical ? wrapper.height - 2*wrapper.mScale*root.lengthExtMargin : wrapper.height;
}
active: root.activeIndicator !== Latte.Types.NoneIndicator
readonly property bool locked: inAttentionAnimation || inNewWindowAnimation
property real visualLockedWidth: root.iconSize + root.internalWidthMargins
property real visualLockedHeight: root.iconSize + root.internalHeightMargins
/* Indicators Properties in order use them*/
readonly property bool isTask: true
readonly property bool isApplet: false
@ -796,7 +809,7 @@ MouseArea{
onContainsMouseChanged:{
if(!containsMouse && !inAnimation) {
pressed=false;
pressed=false;
}
////disable hover effect///

View File

@ -64,7 +64,6 @@ Item{
}
}
property int maxThickness: !root.vertical ? root.zoomFactor*(root.iconSize+root.heightMargins)
: root.zoomFactor*(root.iconSize+root.widthMargins)
@ -128,7 +127,8 @@ Item{
NumberAnimation { duration: root.directRenderAnimationTime }
}
Flow{
IconItem{
id: taskIconItem
anchors.bottom: (root.position === PlasmaCore.Types.BottomPositioned) ? parent.bottom : undefined
anchors.top: (root.position === PlasmaCore.Types.TopPositioned) ? parent.top : undefined
anchors.left: (root.position === PlasmaCore.Types.LeftPositioned) ? parent.left : undefined
@ -138,70 +138,8 @@ Item{
anchors.verticalCenter: root.vertical ? parent.verticalCenter : undefined
width: wrapper.width
height: wrapper.height
flow: root.vertical ? Flow.TopToBottom : Flow.LeftToRight
//! This is used from bouncing attention animation in order to played correctly
Loader{
id: firstPadding
active: (plasmoid.location === PlasmaCore.Types.BottomEdge || plasmoid.location === PlasmaCore.Types.RightEdge)
&& !root.reverseLinesPosition
&& (taskItem.inAttentionAnimation || taskItem.inFastRestoreAnimation)
&& !root.disableAllWindowsFunctionality
visible: active
sourceComponent: Component{
Item{
width: root.vertical ? wrapper.maxThickness-wrapper.width : 1
height: !root.vertical ? wrapper.maxThickness-wrapper.height : 1
/* Rectangle{
width: !root.vertical ? 1 : parent.width
height: !root.vertical ? parent.height : 1
x: !root.vertical ? wrapper.width /2 : 0
y: root.vertical ? wrapper.height /2 : 0
border.width: 1
border.color: "blue"
color: "transparent"
} */
}
}
}
IconItem{ id: taskIconItem}
//! This is used from bouncing attention animation in order to played correctly
Loader{
id: secondPadding
active: (plasmoid.location === PlasmaCore.Types.LeftEdge || plasmoid.location === PlasmaCore.Types.TopEdge)
&& !root.reverseLinesPosition
&& (taskItem.inAttentionAnimation || taskItem.inFastRestoreAnimation)
&& !root.disableAllWindowsFunctionality
visible: active
sourceComponent: Component{
Item{
width: root.vertical ? wrapper.maxThickness-wrapper.width : 1
height: !root.vertical ? wrapper.maxThickness-wrapper.height : 1
/*Rectangle{
width: !root.vertical ? 1 : parent.width
height: !root.vertical ? parent.height : 1
x: !root.vertical ? wrapper.width/2 : 0
y: root.vertical ? wrapper.height/2 : 0
border.width: 1
border.color: "blue"
color: "transparent"
}*/
}
}
}
}//Flow
height:wrapper.height
}
function calculateScales( currentMousePosition ){
if (root.editMode || root.zoomFactor===1 || root.durationTime===0) {

View File

@ -49,7 +49,7 @@ SequentialAnimation{
PropertyAnimation {
target: wrapper
property: (icList.orientation == Qt.Vertical) ? "tempScaleWidth" : "tempScaleHeight"
to: taskItem.containsMouse ? root.zoomFactor : 1 + (0.65 * (root.zoomFactor-1))
to: taskItem.containsMouse ? 1+2*(root.zoomFactor-1) : 1 + (0.65 * (root.zoomFactor-1))
duration: launcherAnimation.speed
easing.type: Easing.OutQuad
}

View File

@ -29,7 +29,7 @@ SequentialAnimation{
id:newWindowAnimation
property int speed: root.durationTime*units.longDuration
property bool isDemandingAttention: (IsDemandingAttention === true)
property bool isDemandingAttention: taskItem.inAttention
property bool containsMouse: taskItem.containsMouse
property bool needsThicknessSent: false //flag to check if the signal for thickness was sent
@ -40,7 +40,7 @@ SequentialAnimation{
PropertyAnimation {
target: wrapper
property: (icList.orientation == Qt.Vertical) ? "tempScaleWidth" : "tempScaleHeight"
to: 1 + (thickPercentage * (root.zoomFactor-1))
to: 1 + (thickPercentage * 2 * (root.zoomFactor-1))
duration: newWindowAnimation.speed
easing.type: Easing.OutQuad
@ -75,6 +75,7 @@ SequentialAnimation{
taskItem.setBlockingAnimation(false);
taskItem.inAttentionAnimation = false;
taskItem.inNewWindowAnimation = false;
}
onStopped: {
@ -97,6 +98,7 @@ SequentialAnimation{
function init(){
taskItem.setBlockingAnimation(true);
taskItem.inNewWindowAnimation = true;
wrapper.tempScaleWidth = wrapper.mScale;
wrapper.tempScaleHeight = wrapper.mScale;