protect the attention animation from mouse hovering

--when the attention animation is played for a task
and the user hovers that task, the animation is ended
smoothly and if the mouse is still hovering the task,
the tasks are restored correctly
pull/1/head
Michail Vourlakos 8 years ago
parent 03180c61e7
commit b30862a5be

@ -449,19 +449,21 @@ MouseArea{
if((!inAnimation)&&(root.dragSource == null)&&(!root.taskInAnimation) && hoverEnabled){
icList.hoveredIndex = index;
mouseEntered = true;
root.mouseWasEntered(index-2, false);
root.mouseWasEntered(index+2, false);
root.mouseWasEntered(index-1, true);
root.mouseWasEntered(index+1, true);
if (icList.orientation == Qt.Horizontal){
icList.currentSpot = mouseX;
wrapper.calculateScales(mouseX);
}
else{
icList.currentSpot = mouseY;
wrapper.calculateScales(mouseY);
if (!inBlockingAnimation) {
mouseEntered = true;
root.mouseWasEntered(index-2, false);
root.mouseWasEntered(index+2, false);
root.mouseWasEntered(index-1, true);
root.mouseWasEntered(index+1, true);
if (icList.orientation == Qt.Horizontal){
icList.currentSpot = mouseX;
wrapper.calculateScales(mouseX);
}
else{
icList.currentSpot = mouseY;
wrapper.calculateScales(mouseY);
}
}
}
}
@ -486,7 +488,7 @@ MouseArea{
}
onPositionChanged: {
if (root.editMode)
if (root.editMode || inBlockingAnimation)
return;
if(!root.latteDock)

@ -540,7 +540,8 @@ Item{
target: mainItemContainer
onContainsMouseChanged: {
if (mainItemContainer.containsMouse && newWindowAnimation.running) {
newWindowAnimation.stop();
newWindowAnimation.pause();
fastRestoreAnimation.start();
}
}
}
@ -555,6 +556,8 @@ Item{
TaskAnimations.TaskRemoveWindowFromGroupAnimation { id: removingAnimation }
TaskAnimations.TaskFastRestoreAnimation { id: fastRestoreAnimation }
//////////// States ////////////////////
states: [
State{

@ -0,0 +1,78 @@
/*
* Copyright 2016 Smith AR <audoban@openmailbox.org>
* Michail Vourlakos <mvourlakos@gmail.com>
*
* This file is part of Latte-Dock
*
* Latte-Dock is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* Latte-Dock is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.0
import org.kde.plasma.plasmoid 2.0
///////Restore Zoom Animation/////
ParallelAnimation{
id: fastRestoreAnimation
property int speed: mainItemContainer.animationTime
PropertyAnimation {
target: wrapper
property: "mScale"
to: 1
duration: fastRestoreAnimation.speed
easing.type: Easing.Linear
}
PropertyAnimation {
target: wrapper
property: "tempScaleWidth"
to: 1
duration: fastRestoreAnimation.speed
easing.type: Easing.Linear
}
PropertyAnimation {
target: wrapper
property: "tempScaleHeight"
to: 1
duration: fastRestoreAnimation.speed
easing.type: Easing.Linear
}
PropertyAnimation {
target: hiddenSpacerLeft
property: "nScale"
to: 0
duration: fastRestoreAnimation.speed
easing.type: Easing.Linear
}
PropertyAnimation {
target: hiddenSpacerRight
property: "nScale"
to: 0
duration: fastRestoreAnimation.speed
easing.type: Easing.Linear
}
onStopped: {
if (newWindowAnimation.paused){
newWindowAnimation.stop();
wrapper.calculateScales((root.iconSize+root.iconMargin)/2);
}
}
}

@ -30,7 +30,7 @@ SequentialAnimation{
property int speed: root.durationTime*units.longDuration
property bool isDemandingAttention: (IsDemandingAttention === true)
property bool entered: mainItemContainer.mouseEntered
property bool containsMouse: mainItemContainer.containsMouse
property bool needsThicknessSent: false //flag to check if the signal for thickness was sent
SequentialAnimation{
@ -80,6 +80,8 @@ SequentialAnimation{
wrapper.tempScaleWidth = 1;
wrapper.tempScaleHeight = 1;
mainItemContainer.setBlockingAnimation(false);
}
onStopped: {
@ -101,6 +103,8 @@ SequentialAnimation{
}
function init(){
mainItemContainer.setBlockingAnimation(true);
wrapper.tempScaleWidth = wrapper.mScale;
wrapper.tempScaleHeight = wrapper.mScale;

Loading…
Cancel
Save