mirror of
https://github.com/KDE/latte-dock.git
synced 2025-01-27 06:03:51 +03:00
Indicators API:Extend animations capabilities
extend indicator.level.requested signals with: --taskLauncherActivated --taskGroupWindowAdded --taskGroupWindowRemoved extend indicator.level.requested properties with: --isIndicatorTaskLauncherAnimationRunning extend indicator info with: --providesInAttentionAnimation --providesTaskLauncherAnimation --providesGroupedWindowAddedAnimation --providesGroupedWindowRemovedAnimation adjust Latte Tasks in order to support properly animations implemented through indicators.
This commit is contained in:
parent
e6d7d8262b
commit
6bf2994840
@ -84,6 +84,66 @@ void Info::setProvidesHoveredAnimation(bool provides)
|
||||
emit providesHoveredAnimationChanged();
|
||||
}
|
||||
|
||||
bool Info::providesInAttentionAnimation() const
|
||||
{
|
||||
return m_providesInAttentionAnimation;
|
||||
}
|
||||
|
||||
void Info::setProvidesInAttentionAnimation(bool provides)
|
||||
{
|
||||
if (m_providesInAttentionAnimation == provides) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_providesInAttentionAnimation = provides;
|
||||
emit providesInAttentionAnimationChanged();
|
||||
}
|
||||
|
||||
bool Info::providesTaskLauncherAnimation() const
|
||||
{
|
||||
return m_providesTaskLauncherAnimation;
|
||||
}
|
||||
|
||||
void Info::setProvidesTaskLauncherAnimation(bool provides)
|
||||
{
|
||||
if (m_providesTaskLauncherAnimation == provides) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_providesTaskLauncherAnimation = provides;
|
||||
emit providesTaskLauncherAnimationChanged();
|
||||
}
|
||||
|
||||
bool Info::providesGroupedWindowAddedAnimation() const
|
||||
{
|
||||
return m_providesGroupedWindowAddedAnimation;
|
||||
}
|
||||
|
||||
void Info::setProvidesGroupedWindowAddedAnimation(bool provides)
|
||||
{
|
||||
if (m_providesGroupedWindowAddedAnimation == provides) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_providesGroupedWindowAddedAnimation = provides;
|
||||
emit providesGroupedWindowAddedAnimationChanged();
|
||||
}
|
||||
|
||||
bool Info::providesGroupedWindowRemovedAnimation() const
|
||||
{
|
||||
return m_providesGroupedWindowRemovedAnimation;
|
||||
}
|
||||
|
||||
void Info::setProvidesGroupedWindowRemovedAnimation(bool provides)
|
||||
{
|
||||
if (m_providesGroupedWindowRemovedAnimation == provides) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_providesGroupedWindowRemovedAnimation = provides;
|
||||
emit providesGroupedWindowRemovedAnimationChanged();
|
||||
}
|
||||
|
||||
bool Info::providesFrontLayer() const
|
||||
{
|
||||
return m_providesFrontLayer;
|
||||
|
@ -22,8 +22,14 @@ class Info: public QObject
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(bool needsIconColors READ needsIconColors WRITE setNeedsIconColors NOTIFY needsIconColorsChanged)
|
||||
Q_PROPERTY(bool needsMouseEventCoordinates READ needsMouseEventCoordinates WRITE setNeedsMouseEventCoordinates NOTIFY needsMouseEventCoordinatesChanged)
|
||||
|
||||
Q_PROPERTY(bool providesClickedAnimation READ providesClickedAnimation WRITE setProvidesClickedAnimation NOTIFY providesClickedAnimationChanged)
|
||||
Q_PROPERTY(bool providesHoveredAnimation READ providesHoveredAnimation WRITE setProvidesHoveredAnimation NOTIFY providesHoveredAnimationChanged)
|
||||
Q_PROPERTY(bool providesInAttentionAnimation READ providesInAttentionAnimation WRITE setProvidesInAttentionAnimation NOTIFY providesInAttentionAnimationChanged)
|
||||
Q_PROPERTY(bool providesTaskLauncherAnimation READ providesTaskLauncherAnimation WRITE setProvidesTaskLauncherAnimation NOTIFY providesTaskLauncherAnimationChanged)
|
||||
Q_PROPERTY(bool providesGroupedWindowAddedAnimation READ providesGroupedWindowAddedAnimation WRITE setProvidesGroupedWindowAddedAnimation NOTIFY providesGroupedWindowAddedAnimationChanged)
|
||||
Q_PROPERTY(bool providesGroupedWindowRemovedAnimation READ providesGroupedWindowRemovedAnimation WRITE setProvidesGroupedWindowRemovedAnimation NOTIFY providesGroupedWindowRemovedAnimationChanged)
|
||||
|
||||
Q_PROPERTY(bool providesFrontLayer READ providesFrontLayer WRITE setProvidesFrontLayer NOTIFY providesFrontLayerChanged)
|
||||
|
||||
Q_PROPERTY(int extraMaskThickness READ extraMaskThickness WRITE setExtraMaskThickness NOTIFY extraMaskThicknessChanged)
|
||||
@ -47,6 +53,18 @@ public:
|
||||
bool providesHoveredAnimation() const;
|
||||
void setProvidesHoveredAnimation(bool provides);
|
||||
|
||||
bool providesInAttentionAnimation() const;
|
||||
void setProvidesInAttentionAnimation(bool provides);
|
||||
|
||||
bool providesTaskLauncherAnimation() const;
|
||||
void setProvidesTaskLauncherAnimation(bool provides);
|
||||
|
||||
bool providesGroupedWindowAddedAnimation() const;
|
||||
void setProvidesGroupedWindowAddedAnimation(bool provides);
|
||||
|
||||
bool providesGroupedWindowRemovedAnimation() const;
|
||||
void setProvidesGroupedWindowRemovedAnimation(bool provides);
|
||||
|
||||
bool providesFrontLayer() const;
|
||||
void setProvidesFrontLayer(bool front);
|
||||
|
||||
@ -67,6 +85,10 @@ signals:
|
||||
void needsMouseEventCoordinatesChanged();
|
||||
void providesClickedAnimationChanged();
|
||||
void providesHoveredAnimationChanged();
|
||||
void providesInAttentionAnimationChanged();
|
||||
void providesTaskLauncherAnimationChanged();
|
||||
void providesGroupedWindowAddedAnimationChanged();
|
||||
void providesGroupedWindowRemovedAnimationChanged();
|
||||
void providesFrontLayerChanged();
|
||||
|
||||
private:
|
||||
@ -74,6 +96,10 @@ private:
|
||||
bool m_needsMouseEventCoordinates{false};
|
||||
bool m_providesClickedAnimation{false};
|
||||
bool m_providesHoveredAnimation{false};
|
||||
bool m_providesInAttentionAnimation{false};
|
||||
bool m_providesTaskLauncherAnimation{false};
|
||||
bool m_providesGroupedWindowAddedAnimation{false};
|
||||
bool m_providesGroupedWindowRemovedAnimation{false};
|
||||
bool m_providesFrontLayer{false};
|
||||
|
||||
int m_extraMaskThickness{0};
|
||||
|
@ -42,6 +42,18 @@ Ability.IndicatorsPrivate {
|
||||
providesClickedAnimation: indicatorLevel.isLoaded && indicatorLevel.item.hasOwnProperty("providesClickedAnimation")
|
||||
&& indicatorLevel.item.providesClickedAnimation
|
||||
|
||||
providesInAttentionAnimation: indicatorLevel.isLoaded && indicatorLevel.item.hasOwnProperty("providesInAttentionAnimation")
|
||||
&& indicatorLevel.item.providesInAttentionAnimation
|
||||
|
||||
providesGroupedWindowAddedAnimation: indicatorLevel.isLoaded && indicatorLevel.item.hasOwnProperty("providesGroupedWindowAddedAnimation")
|
||||
&& indicatorLevel.item.providesGroupedWindowAddedAnimation
|
||||
|
||||
providesGroupedWindowRemovedAnimation: indicatorLevel.isLoaded && indicatorLevel.item.hasOwnProperty("providesGroupedWindowRemovedAnimation")
|
||||
&& indicatorLevel.item.providesGroupedWindowRemovedAnimation
|
||||
|
||||
providesTaskLauncherAnimation: indicatorLevel.isLoaded && indicatorLevel.item.hasOwnProperty("providesTaskLauncherAnimation")
|
||||
&& indicatorLevel.item.providesTaskLauncherAnimation
|
||||
|
||||
extraMaskThickness: {
|
||||
if (indicatorLevel.isLoaded && indicatorLevel.item.hasOwnProperty("extraMaskThickness")) {
|
||||
return indicatorLevel.item.extraMaskThickness;
|
||||
|
@ -66,6 +66,34 @@ AbilityHost.Indicators {
|
||||
value: _indicators.info.providesHoveredAnimation
|
||||
}
|
||||
|
||||
Binding{
|
||||
target: view && view.indicator ? view.indicator.info : null
|
||||
property:"providesInAttentionAnimation"
|
||||
when: view && view.indicator
|
||||
value: _indicators.info.providesInAttentionAnimation
|
||||
}
|
||||
|
||||
Binding{
|
||||
target: view && view.indicator ? view.indicator.info : null
|
||||
property:"providesTaskLauncherAnimation"
|
||||
when: view && view.indicator
|
||||
value: _indicators.info.providesTaskLauncherAnimation
|
||||
}
|
||||
|
||||
Binding{
|
||||
target: view && view.indicator ? view.indicator.info : null
|
||||
property:"providesGroupedWindowAddedAnimation"
|
||||
when: view && view.indicator
|
||||
value: _indicators.info.providesGroupedWindowAddedAnimation
|
||||
}
|
||||
|
||||
Binding{
|
||||
target: view && view.indicator ? view.indicator.info : null
|
||||
property:"providesGroupedWindowRemovedAnimation"
|
||||
when: view && view.indicator
|
||||
value: _indicators.info.providesGroupedWindowRemovedAnimation
|
||||
}
|
||||
|
||||
Binding{
|
||||
target: view && view.indicator ? view.indicator.info : null
|
||||
property:"providesFrontLayer"
|
||||
|
@ -33,6 +33,10 @@ AbilityDefinition.Indicators {
|
||||
info.providesFrontLayer: false
|
||||
info.providesHoveredAnimation: false
|
||||
info.providesClickedAnimation: false
|
||||
info.providesTaskLauncherAnimation: false
|
||||
info.providesInAttentionAnimation: false
|
||||
info.providesGroupedWindowAddedAnimation: false
|
||||
info.providesGroupedWindowRemovedAnimation: false
|
||||
info.extraMaskThickness: 0
|
||||
info.backgroundCornerMargin: 1.00
|
||||
info.lengthPadding: 0.08
|
||||
|
@ -27,6 +27,10 @@ Item{
|
||||
providesFrontLayer: false
|
||||
providesHoveredAnimation: false
|
||||
providesClickedAnimation: false
|
||||
providesTaskLauncherAnimation: false
|
||||
providesInAttentionAnimation: false
|
||||
providesGroupedWindowAddedAnimation: false
|
||||
providesGroupedWindowRemovedAnimation: false
|
||||
|
||||
extraMaskThickness: 0
|
||||
|
||||
|
@ -14,6 +14,11 @@ Item{
|
||||
property bool providesHoveredAnimation: false
|
||||
property bool providesClickedAnimation: false
|
||||
|
||||
property bool providesTaskLauncherAnimation: false
|
||||
property bool providesInAttentionAnimation: false
|
||||
property bool providesGroupedWindowAddedAnimation: false
|
||||
property bool providesGroupedWindowRemovedAnimation: false
|
||||
|
||||
property int extraMaskThickness: 0
|
||||
|
||||
property real minThicknessPadding: 0
|
||||
|
@ -22,6 +22,9 @@ Item{
|
||||
signal mouseReleased(int x, int y, int button);
|
||||
signal shortcutRequestedActivate();
|
||||
signal shortcutRequestedNewInstance();
|
||||
signal taskLauncherActivated();
|
||||
signal taskGroupedWindowAdded();
|
||||
signal taskGroupedWindowRemoved();
|
||||
|
||||
anchors.bottom: (parent && abilityItem.location === PlasmaCore.Types.BottomEdge) ? parent.bottom : undefined
|
||||
anchors.top: (parent && abilityItem.location === PlasmaCore.Types.TopEdge) ? parent.top : undefined
|
||||
@ -117,6 +120,9 @@ Item{
|
||||
readonly property real iconRotation: indicatorBackLayer.level.requested.iconRotation
|
||||
readonly property real iconScale: indicatorBackLayer.level.requested.iconScale
|
||||
|
||||
readonly property bool isIndicatorTaskLauncherAnimationRunning: (indicatorBackLayer.level.requested.isTaskLauncherAnimationRunning
|
||||
|| indicatorFrontLayer.level.requested.isTaskLauncherAnimationRunning)
|
||||
|
||||
readonly property alias indicator: abilityIndicatorObj
|
||||
readonly property alias parabolicItem: _parabolicItem
|
||||
readonly property alias restoreAnimation: _restoreAnimation
|
||||
|
@ -44,4 +44,11 @@ AbilityItem.IndicatorLevel {
|
||||
level.mouseReleased(Math.round(fixedPos.x), Math.round(fixedPos.y), button);
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: abilityItem
|
||||
onTaskLauncherActivated: level.taskLauncherActivated();
|
||||
onTaskGroupedWindowAdded: level.taskGroupedWindowAdded();
|
||||
onTaskGroupedWindowRemoved: level.taskGroupedWindowRemoved();
|
||||
}
|
||||
}
|
||||
|
@ -9,6 +9,9 @@ Item {
|
||||
id: level
|
||||
signal mousePressed(int x, int y, int button);
|
||||
signal mouseReleased(int x, int y, int button);
|
||||
signal taskLauncherActivated();
|
||||
signal taskGroupedWindowAdded();
|
||||
signal taskGroupedWindowRemoved();
|
||||
|
||||
property bool isBackground: true
|
||||
property bool isForeground: false
|
||||
@ -22,6 +25,7 @@ Item {
|
||||
property real iconOpacity: 1.0
|
||||
property real iconRotation: 0
|
||||
property real iconScale: 1.0
|
||||
property bool isTaskLauncherAnimationRunning: false
|
||||
}
|
||||
|
||||
property Item indicator: null
|
||||
|
@ -33,6 +33,22 @@ Item {
|
||||
//! indicator provides its own clicked animations. Latte should not provide
|
||||
//! any clicked animation in that case
|
||||
property bool providesClickedAnimation: false
|
||||
//! indicator provides its own inattention animation. Latte should not provide
|
||||
//! any inattention animation in that case.
|
||||
//! [since v0.10.4]
|
||||
property bool providesInAttentionAnimation: false
|
||||
//! indicator provides its own window added in group animation. Latte should not provide
|
||||
//! any window added in group animation in that case.
|
||||
//! [since v0.10.4]
|
||||
property bool providesGroupedWindowAddedAnimation: false
|
||||
//! indicator provides its own window removed from group animation. Latte should not provide
|
||||
//! any window removed from group animation in that case.
|
||||
//! [since v0.10.4]
|
||||
property bool providesGroupedWindowRemovedAnimation: false
|
||||
//! indicator provides its own task launcher triggered animation. Latte should not provide
|
||||
//! any task launcher triggered animation in that case.
|
||||
//! [since v0.10.4]
|
||||
property bool providesTaskLauncherAnimation: false
|
||||
|
||||
//! this indicator will draw its own indicators for applets
|
||||
//! [since v0.10.0]
|
||||
@ -75,7 +91,7 @@ Item {
|
||||
//! in order to reduce resources usage
|
||||
property var svgImagePaths: []
|
||||
|
||||
//! Level Requested API reference
|
||||
//! LEVEL.Requested API reference
|
||||
|
||||
//! indicator requests different icon X offset from icon center
|
||||
//! [since v0.9.2]
|
||||
@ -101,6 +117,11 @@ Item {
|
||||
//! [since v0.10.4]
|
||||
//property real level.requested.iconScale: 1.0
|
||||
|
||||
//! indicator is playing a task launcher animation. It is used in combination with
|
||||
//! providesTaskLauncherAnimation
|
||||
//! [since v0.10.4]
|
||||
//property bool level.requested.isTaskLauncherAnimationRunning: false
|
||||
|
||||
onLevelChanged: {
|
||||
if (level) {
|
||||
//! initialization on startup, this way when changing from indicator that changes them
|
||||
@ -111,6 +132,7 @@ Item {
|
||||
level.requested.iconOpacity = 1.0;
|
||||
level.requested.iconRotation = 0;
|
||||
level.requested.iconScale = 1.0;
|
||||
level.requested.isTaskLauncherAnimationRunning = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -238,7 +238,7 @@ Item {
|
||||
arraysGarbageCollectorTimer.restart();
|
||||
|
||||
var frozenTaskExists = false;
|
||||
console.log("SET FROZEN :: "+identifier+" - "+scale);
|
||||
//console.log("SET FROZEN :: "+identifier+" - "+scale);
|
||||
var frozenTask = getFrozenTask(identifier);
|
||||
|
||||
if (frozenTask) {
|
||||
|
@ -449,17 +449,6 @@ Item {
|
||||
removingAnimation.removingItem.destroy();
|
||||
}
|
||||
|
||||
Connections{
|
||||
target: taskItem
|
||||
|
||||
onInAttentionChanged:{
|
||||
if (!taskItem.inAttention && newWindowAnimation.running && taskItem.inAttentionAnimation) {
|
||||
newWindowAnimation.pause();
|
||||
fastRestoreAnimation.start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//////////// States ////////////////////
|
||||
states: [
|
||||
State{
|
||||
|
@ -28,12 +28,12 @@ AbilityItem.BasicItem {
|
||||
|
||||
isHidden: !visible || isForcedHidden
|
||||
|
||||
isHiddenSpacerForcedShow: taskItem.inAttentionAnimation || taskItem.inFastRestoreAnimation
|
||||
isHiddenSpacerForcedShow: taskItem.inAttentionBuiltinAnimation || taskItem.inFastRestoreAnimation
|
||||
isHiddenSpacerAnimated: taskItem.inFastRestoreAnimation
|
||||
|| showWindowAnimation.running
|
||||
|| root.inActivityChange
|
||||
|| taskItem.inRemoveStage
|
||||
|| (taskItem.containsMouse && inAttentionAnimation && taskItem.parabolicItem.zoom!==taskItem.abilities.parabolic.factor.zoom)
|
||||
|| (taskItem.containsMouse && inAttentionBuiltinAnimation && taskItem.parabolicItem.zoom!==taskItem.abilities.parabolic.factor.zoom)
|
||||
|
||||
isMonochromaticForcedContentItem: plasmoid.configuration.forceMonochromaticIcons
|
||||
monochromizedItem: taskIcon.monochromizedItem
|
||||
@ -50,14 +50,14 @@ AbilityItem.BasicItem {
|
||||
return isWindow ? model.display : model.AppName;
|
||||
}
|
||||
|
||||
preserveIndicatorInInitialPosition: inBouncingAnimation || inAttentionAnimation || inNewWindowAnimation
|
||||
preserveIndicatorInInitialPosition: inBouncingAnimation || inAttentionBuiltinAnimation || inNewWindowBuiltinAnimation
|
||||
|
||||
parabolicItem.isParabolicEventBlocked: root.dragSource
|
||||
|| !hoverEnabled
|
||||
|| !taskItem.abilities.myView.isShownFully
|
||||
|| inAnimation
|
||||
|| (inBlockingAnimation && !(inAttentionAnimation||inFastRestoreAnimation))
|
||||
parabolicItem.isUpdatingOnlySpacers: inAttentionAnimation || inBouncingAnimation
|
||||
|| (inBlockingAnimation && !(inAttentionBuiltinAnimation || inFastRestoreAnimation))
|
||||
parabolicItem.isUpdatingOnlySpacers: inAttentionBuiltinAnimation || inBouncingAnimation
|
||||
|
||||
property alias hoverEnabled: taskMouseArea.hoverEnabled
|
||||
property alias pressed: taskMouseArea.pressed
|
||||
@ -72,15 +72,17 @@ AbilityItem.BasicItem {
|
||||
/*animations flags*/
|
||||
property bool inAnimation: true
|
||||
property bool inAddRemoveAnimation: true
|
||||
property bool inAttentionAnimation: false
|
||||
property bool inAttentionBuiltinAnimation: false
|
||||
property bool inBlockingAnimation: false
|
||||
property bool inBouncingAnimation: false
|
||||
property bool inFastRestoreAnimation: false
|
||||
property bool inNewWindowAnimation: false
|
||||
property bool inNewWindowBuiltinAnimation: false
|
||||
property bool inPopup: false
|
||||
property bool inRemoveStage: false
|
||||
|
||||
property bool isLauncherAnimationRunning: false
|
||||
property bool isLauncherBuiltinAnimationRunning: false
|
||||
property bool isLauncherAnimationRunning: isLauncherBuiltinAnimationRunning
|
||||
|| (taskItem.abilities.indicators.info.providesTaskLauncherAnimation && isIndicatorTaskLauncherAnimationRunning)
|
||||
|
||||
//! after clicking to show/hide preview enter events are trigerred even though the should not
|
||||
property bool showPreviewsIsBlockedFromReleaseEvent: false
|
||||
@ -107,6 +109,7 @@ AbilityItem.BasicItem {
|
||||
property bool hoveredFromDragging: (mouseHandler.hoveredItem === taskItem) || (mouseHandler.ignoredItem === taskItem)
|
||||
|
||||
property bool wheelIsBlocked: false
|
||||
property bool hasAddedWaitingLauncher: false
|
||||
|
||||
property int badgeIndicator: 0 //it is used from external apps
|
||||
property int lastValidIndex: -1 //used for the removal animation
|
||||
@ -246,9 +249,6 @@ AbilityItem.BasicItem {
|
||||
property QtObject contextMenu: null
|
||||
|
||||
signal checkWindowsStates();
|
||||
signal groupWindowAdded();
|
||||
signal groupWindowRemoved();
|
||||
signal launcherAnimationRequested();
|
||||
|
||||
SubWindows{
|
||||
id: subWindows
|
||||
@ -264,13 +264,13 @@ AbilityItem.BasicItem {
|
||||
&& (windowsCount > previousCount)
|
||||
&& !(taskItem.containsMouse)
|
||||
&& !root.dragSource ){
|
||||
taskItem.groupWindowAdded();
|
||||
taskItem.taskGroupedWindowAdded();
|
||||
} else if ((windowsCount >= 1)
|
||||
&& (windowsCount < previousCount)
|
||||
&& !root.dragSource
|
||||
&& !taskItem.delayingRemove){
|
||||
//sometimes this is triggered in dragging with no reason
|
||||
taskItem.groupWindowRemoved();
|
||||
taskItem.taskGroupedWindowRemoved();
|
||||
}
|
||||
|
||||
if (windowsCount>=1) {
|
||||
@ -411,13 +411,23 @@ AbilityItem.BasicItem {
|
||||
subWindows.activateNextTask();
|
||||
}
|
||||
|
||||
function activateLauncher() {
|
||||
if (LatteCore.WindowSystem.compositingActive) {
|
||||
taskItem.taskLauncherActivated();
|
||||
hasAddedWaitingLauncher = true;
|
||||
tasksExtendedManager.addWaitingLauncher(taskItem.launcherUrl);
|
||||
}
|
||||
|
||||
if (root.disableAllWindowsFunctionality) {
|
||||
tasksModel.requestNewInstance(modelIndex());
|
||||
} else {
|
||||
tasksModel.requestActivate(modelIndex());
|
||||
}
|
||||
}
|
||||
|
||||
function activateTask() {
|
||||
if( taskItem.isLauncher || root.disableAllWindowsFunctionality){
|
||||
if (LatteCore.WindowSystem.compositingActive) {
|
||||
taskItem.launcherAnimationRequested();
|
||||
} else {
|
||||
launcherAction();
|
||||
}
|
||||
activateLauncher();
|
||||
} else{
|
||||
if (model.IsGroupParent) {
|
||||
var canPresentWindowsIsSupported = LatteCore.WindowSystem.compositingActive && (root.plasmaGreaterThan522 ? backend.canPresentWindows : backend.canPresentWindows());
|
||||
@ -523,20 +533,6 @@ AbilityItem.BasicItem {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function launcherAction(){
|
||||
if (LatteCore.WindowSystem.compositingActive) {
|
||||
inBouncingAnimation = true;
|
||||
tasksExtendedManager.addWaitingLauncher(taskItem.launcherUrl);
|
||||
}
|
||||
|
||||
if (root.disableAllWindowsFunctionality) {
|
||||
tasksModel.requestNewInstance(modelIndex());
|
||||
} else {
|
||||
tasksModel.requestActivate(modelIndex());
|
||||
}
|
||||
}
|
||||
|
||||
///window previews///
|
||||
function generateSubText(task) {
|
||||
var subTextEntries = new Array();
|
||||
@ -696,7 +692,10 @@ AbilityItem.BasicItem {
|
||||
|
||||
function slotWaitingLauncherRemoved(launch) {
|
||||
if ((isWindow || isStartup || isLauncher) && !visible && launch === launcherUrl) {
|
||||
taskItem.parabolicItem.zoom = 1;
|
||||
if (!taskItem.abilities.indicators.info.providesTaskLauncherAnimation) {
|
||||
//! this is needed only from in-built launcher animation to restore zoom smoothly
|
||||
taskItem.parabolicItem.zoom = 1;
|
||||
}
|
||||
visible = true;
|
||||
}
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ MouseArea {
|
||||
//console.log("Released Task Delegate...");
|
||||
_resistanerTimer.stop();
|
||||
|
||||
if(pressed && (!inBlockingAnimation || inAttentionAnimation) && !isSeparator){
|
||||
if(pressed && (!inBlockingAnimation || inAttentionBuiltinAnimation) && !isSeparator){
|
||||
|
||||
if (modifierAccepted(mouse) && !root.disableAllWindowsFunctionality){
|
||||
if( !taskItem.isLauncher ){
|
||||
@ -250,7 +250,7 @@ MouseArea {
|
||||
scrollableList.decreasePos();
|
||||
} else {
|
||||
if (isLauncher || root.disableAllWindowsFunctionality) {
|
||||
taskItem.launcherAnimationRequested();
|
||||
taskItem.activateLauncher();
|
||||
} else if (isGroupParent) {
|
||||
subWindows.activateNextTask();
|
||||
} else {
|
||||
|
@ -43,7 +43,7 @@ Item{
|
||||
|
||||
Binding {
|
||||
target: taskItem
|
||||
property: "isLauncherAnimationRunning"
|
||||
property: "isLauncherBuiltinAnimationRunning"
|
||||
value: running
|
||||
}
|
||||
|
||||
@ -89,25 +89,27 @@ Item{
|
||||
}
|
||||
|
||||
function startLauncherAnimation(){
|
||||
if(root.launcherBouncingEnabled){
|
||||
if (taskItem.abilities.indicators.info.providesTaskLauncherAnimation) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(root.launcherBouncingEnabled) {
|
||||
taskItem.animationStarted();
|
||||
init();
|
||||
launcherAnimationLoader.item.start();
|
||||
taskItem.launcherAction();
|
||||
} else {
|
||||
launcherAnimationLoader.item.stop();
|
||||
taskItem.launcherAction();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Component.onCompleted: {
|
||||
taskItem.launcherAnimationRequested.connect(startLauncherAnimation);
|
||||
taskItem.taskLauncherActivated.connect(startLauncherAnimation);
|
||||
}
|
||||
|
||||
Component.onDestruction: {
|
||||
clearAnimationsSignals();
|
||||
taskItem.launcherAnimationRequested.disconnect(startLauncherAnimation);
|
||||
taskItem.taskLauncherActivated.disconnect(startLauncherAnimation);
|
||||
}
|
||||
}
|
||||
/////////////////// end of launcher animation
|
||||
|
@ -37,6 +37,17 @@ Item{
|
||||
}
|
||||
}
|
||||
|
||||
Connections{
|
||||
target: taskItem
|
||||
|
||||
onInAttentionChanged:{
|
||||
if (!taskItem.inAttention && newWindowAnimation.running && taskItem.inAttentionBuiltinAnimation) {
|
||||
newWindowAnimation.pause();
|
||||
fastRestoreAnimation.start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function clear(){
|
||||
newWindowAnimationLoader.item.stop();
|
||||
|
||||
@ -44,8 +55,8 @@ Item{
|
||||
taskItem.parabolicItem.zoomThickness = 1.0;
|
||||
|
||||
taskItem.setBlockingAnimation(false);
|
||||
taskItem.inAttentionAnimation = false;
|
||||
taskItem.inNewWindowAnimation = false;
|
||||
taskItem.inAttentionBuiltinAnimation = false;
|
||||
taskItem.inNewWindowBuiltinAnimation = false;
|
||||
}
|
||||
|
||||
function pause() {
|
||||
@ -68,17 +79,23 @@ Item{
|
||||
|
||||
function init(){
|
||||
taskItem.setBlockingAnimation(true);
|
||||
taskItem.inNewWindowAnimation = true;
|
||||
taskItem.inNewWindowBuiltinAnimation = true;
|
||||
|
||||
taskItem.parabolicItem.zoomLength = taskItem.parabolicItem.zoom;
|
||||
taskItem.parabolicItem.zoomThickness = taskItem.parabolicItem.zoom;
|
||||
|
||||
taskItem.inAttentionAnimation = isDemandingAttention;
|
||||
taskItem.inAttentionBuiltinAnimation = isDemandingAttention;
|
||||
|
||||
taskItem.abilities.animations.needThickness.addEvent(needThicknessEvent);
|
||||
}
|
||||
|
||||
function startNewWindowAnimation(){
|
||||
if (isDemandingAttention && taskItem.abilities.indicators.info.providesInAttentionAnimation) {
|
||||
return;
|
||||
} else if (!isDemandingAttention && taskItem.abilities.indicators.info.providesGroupedWindowAddedAnimation) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!taskItem.abilities.myView.isHidden
|
||||
&& ((root.windowInAttentionEnabled && isDemandingAttention)
|
||||
|| root.windowAddedInGroupEnabled)){
|
||||
@ -92,11 +109,11 @@ Item{
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
taskItem.groupWindowAdded.connect(startNewWindowAnimation);
|
||||
taskItem.taskGroupedWindowAdded.connect(startNewWindowAnimation);
|
||||
}
|
||||
|
||||
Component.onDestruction: {
|
||||
taskItem.groupWindowAdded.disconnect(startNewWindowAnimation);
|
||||
taskItem.taskGroupedWindowAdded.disconnect(startNewWindowAnimation);
|
||||
taskItem.abilities.animations.needThickness.removeEvent(needThicknessEvent);
|
||||
}
|
||||
}
|
||||
|
@ -109,6 +109,18 @@ SequentialAnimation {
|
||||
if (taskItem.parabolicItem.zoom > 1 && !taskRealRemovalAnimation.enabledAnimation
|
||||
&& !taskItem.inBouncingAnimation && LatteCore.WindowSystem.compositingActive) {
|
||||
tasksExtendedManager.setFrozenTask(taskItem.launcherUrl, taskItem.parabolicItem.zoom);
|
||||
} else {
|
||||
//! remove frozen task if it is deprecated. This fixes the libreoffice launcher issue with custom indicator launcher animations,
|
||||
//! steps to reproduce:
|
||||
//! 1. set an indicator that provides its own launcher animation such as "Animated Dot"
|
||||
//! 2. enable parabolic effect zoom
|
||||
//! 3. click on libreoffice writer launcher and keep the mouse inside the launcher
|
||||
//! 4. close libreoffice writer window from its decoration close button
|
||||
//! 5. libreoffice writer launcher is zoomed even though it should not
|
||||
var frozenTask = tasksExtendedManager.getFrozenTask(taskItem.launcherUrl);
|
||||
if (frozenTask && frozenTask.zoom>1) {
|
||||
tasksExtendedManager.removeFrozenTask(taskItem.launcherUrl);
|
||||
}
|
||||
}
|
||||
|
||||
if (taskItem.isLauncherAnimationRunning && !taskItem.isSeparator) {
|
||||
@ -195,9 +207,13 @@ SequentialAnimation {
|
||||
taskItem.visible = false;
|
||||
|
||||
//send signal that the launcher is really removing
|
||||
if (taskItem.inBouncingAnimation) {
|
||||
if (taskItem.hasAddedWaitingLauncher) {
|
||||
tasksExtendedManager.removeWaitingLauncher(taskItem.launcherUrl);
|
||||
taskItem.abilities.parabolic.setDirectRenderingEnabled(false);
|
||||
|
||||
if (!taskItem.abilities.indicators.info.providesTaskLauncherAnimation) {
|
||||
//! this is needed only from in-built launcher animation to restore zoom smoothly to neighbour tasks
|
||||
taskItem.abilities.parabolic.setDirectRenderingEnabled(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -29,17 +29,21 @@ Item{
|
||||
}
|
||||
|
||||
function removeTask(){
|
||||
if (taskItem.abilities.indicators.info.providesGroupedWindowRemovedAnimation) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(!taskIconContainer.toBeDestroyed && root.windowRemovedFromGroupEnabled){
|
||||
removingAnimation.init();
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
taskItem.groupWindowRemoved.connect(removeTask);
|
||||
taskItem.taskGroupedWindowRemoved.connect(removeTask);
|
||||
}
|
||||
|
||||
Component.onDestruction: {
|
||||
taskItem.groupWindowRemoved.disconnect(removeTask);
|
||||
taskItem.taskGroupedWindowRemoved.disconnect(removeTask);
|
||||
}
|
||||
|
||||
///////////// Component for animating removing window from group
|
||||
|
@ -77,7 +77,7 @@ SequentialAnimation{
|
||||
if(taskItem.isWindow || taskItem.isStartup){
|
||||
publishGeometryTimer.start();
|
||||
if (taskItem.isDemandingAttention){
|
||||
taskItem.groupWindowAdded();
|
||||
taskItem.taskGroupedWindowAdded();
|
||||
}
|
||||
}
|
||||
taskItem.inAnimation = false;
|
||||
@ -171,7 +171,7 @@ SequentialAnimation{
|
||||
taskItem.parabolicItem.zoomThickness = 1.0;
|
||||
}
|
||||
|
||||
//! by enabling it we break the bouncing animation
|
||||
//! by enabling it we break the bouncing animation and the indicators launchers animations
|
||||
//taskItem.visible = true;
|
||||
taskItem.parabolicItem.opacity = 1;
|
||||
taskItem.inAnimation = false;
|
||||
|
@ -27,7 +27,7 @@ SequentialAnimation{
|
||||
duration: newWindowAnimation.speed
|
||||
easing.type: Easing.OutQuad
|
||||
|
||||
property real thickPercentage: taskItem.inAttentionAnimation ? 0.8 : 0.6
|
||||
property real thickPercentage: taskItem.inAttentionBuiltinAnimation ? 0.8 : 0.6
|
||||
}
|
||||
|
||||
PropertyAnimation {
|
||||
|
@ -288,6 +288,7 @@ PlasmaComponents.Page {
|
||||
Layout.maximumWidth: dialog.optionsWidth
|
||||
text: i18n("Bounce launchers when triggered")
|
||||
value: tasks.configuration.animationLauncherBouncing
|
||||
enabled: !latteView.indicator.info.providesTaskLauncherAnimation
|
||||
|
||||
onClicked: {
|
||||
tasks.configuration.animationLauncherBouncing = !tasks.configuration.animationLauncherBouncing;
|
||||
@ -298,6 +299,7 @@ PlasmaComponents.Page {
|
||||
Layout.maximumWidth: dialog.optionsWidth
|
||||
text: i18n("Bounce tasks that need attention")
|
||||
value: tasks.configuration.animationWindowInAttention
|
||||
enabled: !latteView.indicator.info.providesInAttentionAnimation
|
||||
|
||||
onClicked: {
|
||||
tasks.configuration.animationWindowInAttention = !tasks.configuration.animationWindowInAttention;
|
||||
@ -318,6 +320,7 @@ PlasmaComponents.Page {
|
||||
Layout.maximumWidth: dialog.optionsWidth
|
||||
text: i18n("Grouped tasks bounce their new windows")
|
||||
value: tasks.configuration.animationWindowAddedInGroup
|
||||
enabled: !latteView.indicator.info.providesGroupedWindowAddedAnimation
|
||||
|
||||
onClicked: {
|
||||
tasks.configuration.animationWindowAddedInGroup = !tasks.configuration.animationWindowAddedInGroup;
|
||||
@ -328,6 +331,7 @@ PlasmaComponents.Page {
|
||||
Layout.maximumWidth: dialog.optionsWidth
|
||||
text: i18n("Grouped tasks slide out their closed windows")
|
||||
value: tasks.configuration.animationWindowRemovedFromGroup
|
||||
enabled: !latteView.indicator.info.providesGroupedWindowRemovedAnimation
|
||||
|
||||
onClicked: {
|
||||
tasks.configuration.animationWindowRemovedFromGroup = !tasks.configuration.animationWindowRemovedFromGroup;
|
||||
|
Loading…
x
Reference in New Issue
Block a user