mirror of
https://github.com/KDE/latte-dock.git
synced 2024-12-28 03:21:38 +03:00
fix attention animation with new indicators
This commit is contained in:
parent
388a5cdb99
commit
e40e1556a9
@ -53,10 +53,7 @@ MouseArea{
|
|||||||
return root.vertical ? separatorItem.width : (root.dragSource || root.editMode ? 5+root.lengthMargins : 0);
|
return root.vertical ? separatorItem.width : (root.dragSource || root.editMode ? 5+root.lengthMargins : 0);
|
||||||
|
|
||||||
if (root.vertical) {
|
if (root.vertical) {
|
||||||
if (!inAttentionAnimation)
|
|
||||||
return wrapper.width;
|
return wrapper.width;
|
||||||
else
|
|
||||||
return wrapper.maxThickness;
|
|
||||||
} else {
|
} else {
|
||||||
return hiddenSpacerLeft.width+wrapper.width+hiddenSpacerRight.width;
|
return hiddenSpacerLeft.width+wrapper.width+hiddenSpacerRight.width;
|
||||||
}
|
}
|
||||||
@ -76,10 +73,7 @@ MouseArea{
|
|||||||
if (root.vertical) {
|
if (root.vertical) {
|
||||||
return hiddenSpacerLeft.height + wrapper.height + hiddenSpacerRight.height;
|
return hiddenSpacerLeft.height + wrapper.height + hiddenSpacerRight.height;
|
||||||
} else {
|
} else {
|
||||||
if (!inAttentionAnimation)
|
|
||||||
return wrapper.height;
|
return wrapper.height;
|
||||||
else
|
|
||||||
return wrapper.maxThickness;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,6 +99,7 @@ MouseArea{
|
|||||||
property bool inBouncingAnimation: false
|
property bool inBouncingAnimation: false
|
||||||
property bool inFastRestoreAnimation: false
|
property bool inFastRestoreAnimation: false
|
||||||
property bool inMimicParabolicAnimation: false
|
property bool inMimicParabolicAnimation: false
|
||||||
|
property bool inNewWindowAnimation: false
|
||||||
property real mimicParabolicScale: -1
|
property real mimicParabolicScale: -1
|
||||||
property bool inPopup: false
|
property bool inPopup: false
|
||||||
property bool inRemoveStage: false
|
property bool inRemoveStage: false
|
||||||
@ -446,11 +441,29 @@ MouseArea{
|
|||||||
anchors.horizontalCenter: !root.vertical ? parent.horizontalCenter : undefined
|
anchors.horizontalCenter: !root.vertical ? parent.horizontalCenter : undefined
|
||||||
anchors.verticalCenter: root.vertical ? parent.verticalCenter : undefined
|
anchors.verticalCenter: root.vertical ? parent.verticalCenter : undefined
|
||||||
|
|
||||||
width: !root.vertical ? wrapper.width - 2*wrapper.mScale*root.lengthExtMargin : wrapper.width
|
width: {
|
||||||
height: root.vertical ? wrapper.height - 2*wrapper.mScale*root.lengthExtMargin : wrapper.height
|
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
|
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*/
|
/* Indicators Properties in order use them*/
|
||||||
readonly property bool isTask: true
|
readonly property bool isTask: true
|
||||||
readonly property bool isApplet: false
|
readonly property bool isApplet: false
|
||||||
|
@ -64,7 +64,6 @@ Item{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
property int maxThickness: !root.vertical ? root.zoomFactor*(root.iconSize+root.heightMargins)
|
property int maxThickness: !root.vertical ? root.zoomFactor*(root.iconSize+root.heightMargins)
|
||||||
: root.zoomFactor*(root.iconSize+root.widthMargins)
|
: root.zoomFactor*(root.iconSize+root.widthMargins)
|
||||||
|
|
||||||
@ -128,7 +127,8 @@ Item{
|
|||||||
NumberAnimation { duration: root.directRenderAnimationTime }
|
NumberAnimation { duration: root.directRenderAnimationTime }
|
||||||
}
|
}
|
||||||
|
|
||||||
Flow{
|
IconItem{
|
||||||
|
id: taskIconItem
|
||||||
anchors.bottom: (root.position === PlasmaCore.Types.BottomPositioned) ? parent.bottom : undefined
|
anchors.bottom: (root.position === PlasmaCore.Types.BottomPositioned) ? parent.bottom : undefined
|
||||||
anchors.top: (root.position === PlasmaCore.Types.TopPositioned) ? parent.top : undefined
|
anchors.top: (root.position === PlasmaCore.Types.TopPositioned) ? parent.top : undefined
|
||||||
anchors.left: (root.position === PlasmaCore.Types.LeftPositioned) ? parent.left : undefined
|
anchors.left: (root.position === PlasmaCore.Types.LeftPositioned) ? parent.left : undefined
|
||||||
@ -138,70 +138,8 @@ Item{
|
|||||||
anchors.verticalCenter: root.vertical ? parent.verticalCenter : undefined
|
anchors.verticalCenter: root.vertical ? parent.verticalCenter : undefined
|
||||||
|
|
||||||
width: wrapper.width
|
width: wrapper.width
|
||||||
height: wrapper.height
|
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
|
|
||||||
|
|
||||||
|
|
||||||
function calculateScales( currentMousePosition ){
|
function calculateScales( currentMousePosition ){
|
||||||
if (root.editMode || root.zoomFactor===1 || root.durationTime===0) {
|
if (root.editMode || root.zoomFactor===1 || root.durationTime===0) {
|
||||||
|
@ -49,7 +49,7 @@ SequentialAnimation{
|
|||||||
PropertyAnimation {
|
PropertyAnimation {
|
||||||
target: wrapper
|
target: wrapper
|
||||||
property: (icList.orientation == Qt.Vertical) ? "tempScaleWidth" : "tempScaleHeight"
|
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
|
duration: launcherAnimation.speed
|
||||||
easing.type: Easing.OutQuad
|
easing.type: Easing.OutQuad
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ SequentialAnimation{
|
|||||||
id:newWindowAnimation
|
id:newWindowAnimation
|
||||||
|
|
||||||
property int speed: root.durationTime*units.longDuration
|
property int speed: root.durationTime*units.longDuration
|
||||||
property bool isDemandingAttention: (IsDemandingAttention === true)
|
property bool isDemandingAttention: taskItem.inAttention
|
||||||
property bool containsMouse: taskItem.containsMouse
|
property bool containsMouse: taskItem.containsMouse
|
||||||
property bool needsThicknessSent: false //flag to check if the signal for thickness was sent
|
property bool needsThicknessSent: false //flag to check if the signal for thickness was sent
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ SequentialAnimation{
|
|||||||
PropertyAnimation {
|
PropertyAnimation {
|
||||||
target: wrapper
|
target: wrapper
|
||||||
property: (icList.orientation == Qt.Vertical) ? "tempScaleWidth" : "tempScaleHeight"
|
property: (icList.orientation == Qt.Vertical) ? "tempScaleWidth" : "tempScaleHeight"
|
||||||
to: 1 + (thickPercentage * (root.zoomFactor-1))
|
to: 1 + (thickPercentage * 2 * (root.zoomFactor-1))
|
||||||
duration: newWindowAnimation.speed
|
duration: newWindowAnimation.speed
|
||||||
easing.type: Easing.OutQuad
|
easing.type: Easing.OutQuad
|
||||||
|
|
||||||
@ -75,6 +75,7 @@ SequentialAnimation{
|
|||||||
|
|
||||||
taskItem.setBlockingAnimation(false);
|
taskItem.setBlockingAnimation(false);
|
||||||
taskItem.inAttentionAnimation = false;
|
taskItem.inAttentionAnimation = false;
|
||||||
|
taskItem.inNewWindowAnimation = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
onStopped: {
|
onStopped: {
|
||||||
@ -97,6 +98,7 @@ SequentialAnimation{
|
|||||||
|
|
||||||
function init(){
|
function init(){
|
||||||
taskItem.setBlockingAnimation(true);
|
taskItem.setBlockingAnimation(true);
|
||||||
|
taskItem.inNewWindowAnimation = true;
|
||||||
|
|
||||||
wrapper.tempScaleWidth = wrapper.mScale;
|
wrapper.tempScaleWidth = wrapper.mScale;
|
||||||
wrapper.tempScaleHeight = wrapper.mScale;
|
wrapper.tempScaleHeight = wrapper.mScale;
|
||||||
|
Loading…
Reference in New Issue
Block a user