fix for filtering tasks based on launchers

pull/2/head
Michail Vourlakos 7 years ago
parent 73e9bfae5e
commit e6d87a0097

@ -27,12 +27,14 @@ import org.kde.latte 0.1 as Latte
SequentialAnimation { SequentialAnimation {
id: taskRealRemovalAnimation id: taskRealRemovalAnimation
PropertyAction { target: mainItemContainer; property: "ListView.delayRemove"; value: true } PropertyAction { target: mainItemContainer; property: "ListView.delayRemove"; value: true }
PropertyAction { target: mainItemContainer; property: "inAnimation"; value: true }
PropertyAction { target: mainItemContainer; property: "inAddRemoveAnimation"; value: true }
PropertyAction { target: mainItemContainer; property: "inRemoveStage"; value: true } PropertyAction { target: mainItemContainer; property: "inRemoveStage"; value: true }
//Animation Add/Remove (1) - when is window with no launcher, animations enabled //Animation Add/Remove (1) - when is window with no launcher, animations enabled
//Animation Add/Remove (4) - the user removes a launcher, animation enabled //Animation Add/Remove (4) - the user removes a launcher, animation enabled
property bool animation1: ((((tasksModel.launcherPosition(mainItemContainer.launcherUrl) == -1) property bool animation1: ((((tasksModel.launcherPosition(mainItemContainer.launcherUrl) === -1)
&& (tasksModel.launcherPosition(mainItemContainer.launcherUrlWithIcon) == -1) ) && (tasksModel.launcherPosition(mainItemContainer.launcherUrlWithIcon) === -1) )
|| !launcherIsPresent(mainItemContainer.launcherUrl)) || !launcherIsPresent(mainItemContainer.launcherUrl))
&& !mainItemContainer.isStartup && Latte.WindowSystem.compositingActive) && !mainItemContainer.isStartup && Latte.WindowSystem.compositingActive)
@ -42,13 +44,10 @@ SequentialAnimation {
property bool enabledAnimation: (animation1 || animation4) && (root.durationTime !== 0) property bool enabledAnimation: (animation1 || animation4) && (root.durationTime !== 0)
&& !mainItemContainer.inBouncingAnimation && !mainItemContainer.inBouncingAnimation
&& !mainItemContainer.isSeparator; && !mainItemContainer.isSeparator
&& mainItemContainer.visible;
ScriptAction{ ScriptAction{
script:{ script:{
mainItemContainer.inAnimation = true;
mainItemContainer.inAddRemoveAnimation = true;
mainItemContainer.inRemoveStage = true;
//! When a window is removed and afterwards its launcher must be shown immediately! //! When a window is removed and afterwards its launcher must be shown immediately!
if (!enabledAnimation && mainItemContainer.isWindow && !mainItemContainer.isSeparator if (!enabledAnimation && mainItemContainer.isWindow && !mainItemContainer.isSeparator
&& tasksModel.launcherPosition(mainItemContainer.launcherUrl) !== -1 && tasksModel.launcherPosition(mainItemContainer.launcherUrl) !== -1
@ -139,7 +138,7 @@ SequentialAnimation {
PropertyAnimation { PropertyAnimation {
target: wrapper target: wrapper
property: (icList.orientation == Qt.Vertical) ? "tempScaleWidth" : "tempScaleHeight" property: (icList.orientation === Qt.Vertical) ? "tempScaleWidth" : "tempScaleHeight"
to: 0 to: 0
duration: taskRealRemovalAnimation.enabledAnimation ? 1.35*showWindowAnimation.speed : 0 duration: taskRealRemovalAnimation.enabledAnimation ? 1.35*showWindowAnimation.speed : 0
easing.type: Easing.InQuad easing.type: Easing.InQuad
@ -149,7 +148,7 @@ SequentialAnimation {
//smooth move into place the surrounding tasks //smooth move into place the surrounding tasks
PropertyAnimation { PropertyAnimation {
target: wrapper target: wrapper
property: (icList.orientation == Qt.Vertical) ? "tempScaleHeight" : "tempScaleWidth" property: (icList.orientation === Qt.Vertical) ? "tempScaleHeight" : "tempScaleWidth"
to: 0 to: 0
duration: taskRealRemovalAnimation.enabledAnimation ? 1.35*showWindowAnimation.speed : 0 duration: taskRealRemovalAnimation.enabledAnimation ? 1.35*showWindowAnimation.speed : 0
easing.type: Easing.InQuad easing.type: Easing.InQuad
@ -165,8 +164,6 @@ SequentialAnimation {
root.signalAnimationsNeedLength(-1); root.signalAnimationsNeedLength(-1);
mainItemContainer.inAnimation = false;
if(mainItemContainer.launcherUrl===root.launcherForRemoval && mainItemContainer.isLauncher) if(mainItemContainer.launcherUrl===root.launcherForRemoval && mainItemContainer.isLauncher)
root.launcherForRemoval=""; root.launcherForRemoval="";
@ -185,14 +182,19 @@ SequentialAnimation {
} }
} }
mainItemContainer.visible = false;
//send signal that the launcher is really removing //send signal that the launcher is really removing
if (mainItemContainer.inBouncingAnimation) { if (mainItemContainer.inBouncingAnimation) {
mainItemContainer.visible = false;
root.removeWaitingLauncher(mainItemContainer.launcherUrl); root.removeWaitingLauncher(mainItemContainer.launcherUrl);
root.setGlobalDirectRender(false); root.setGlobalDirectRender(false);
} }
} }
} }
PropertyAction { target: mainItemContainer; property: "inAnimation"; value: false }
PropertyAction { target: mainItemContainer; property: "inAddRemoveAnimation"; value: false }
PropertyAction { target: mainItemContainer; property: "inRemoveStage"; value: false }
PropertyAction { target: mainItemContainer; property: "ListView.delayRemove"; value: false } PropertyAction { target: mainItemContainer; property: "ListView.delayRemove"; value: false }
} }

Loading…
Cancel
Save