diff --git a/plasmoid/package/contents/ui/task/AudioStream.qml b/plasmoid/package/contents/ui/task/AudioStream.qml index a14c7a9e4..7f34364d7 100644 --- a/plasmoid/package/contents/ui/task/AudioStream.qml +++ b/plasmoid/package/contents/ui/task/AudioStream.qml @@ -66,7 +66,7 @@ Item { border.color: root.minimizedDotColor radius: width/2 - //opacity: mainItemContainer.playingAudio && !mainItemContainer.muted && mainItemContainer.volume>0 ? 1 : 0.85 + //opacity: taskItem.playingAudio && !taskItem.muted && taskItem.volume>0 ? 1 : 0.85 } Latte.IconItem{ @@ -76,13 +76,13 @@ Item { height: width usesPlasmaTheme: true - //opacity: mainItemContainer.playingAudio && !mainItemContainer.muted ? 1 : 0.85 + //opacity: taskItem.playingAudio && !taskItem.muted ? 1 : 0.85 source: { - if (mainItemContainer.volume <= 0 || mainItemContainer.muted) { + if (taskItem.volume <= 0 || taskItem.muted) { return "audio-volume-muted"; - } else if (mainItemContainer.volume <= 25) { + } else if (taskItem.volume <= 25) { return "audio-volume-low"; - } else if (mainItemContainer.volume <= 75) { + } else if (taskItem.volume <= 75) { return "audio-volume-medium"; } else { return "audio-volume-high" ; @@ -93,7 +93,7 @@ Item { id: audioBadgeMouseArea anchors.fill: parent - onClicked: mainItemContainer.toggleMuted(); + onClicked: taskItem.toggleMuted(); property bool blockWheel: false; onWheel: { @@ -104,9 +104,9 @@ Item { var angle = wheel.angleDelta.y / 8; if (angle > 2) - mainItemContainer.increaseVolume(); + taskItem.increaseVolume(); else if (angle < -2) - mainItemContainer.decreaseVolume(); + taskItem.decreaseVolume(); blockWheel = true; scrollDelayer.start(); diff --git a/plasmoid/package/contents/ui/task/GroupItem.qml b/plasmoid/package/contents/ui/task/GroupItem.qml index c3d78413a..b8749497a 100644 --- a/plasmoid/package/contents/ui/task/GroupItem.qml +++ b/plasmoid/package/contents/ui/task/GroupItem.qml @@ -40,7 +40,7 @@ Item{ //property color isShownColor: plasmoid.configuration.threeColorsWindows ? root.shownDotColor : isActiveColor //property color isShownColor: isActiveColor property color minimizedColor: root.threeColorsWindows ? root.minimizedDotColor : isActiveColor - property color notActiveColor: mainItemContainer.hasMinimized ? minimizedColor : isActiveColor + property color notActiveColor: taskItem.hasMinimized ? minimizedColor : isActiveColor /*Rectangle{ anchors.fill: parent @@ -63,7 +63,7 @@ Item{ id:firstPoint visible: ( !IsLauncher ) ? true: false - basicColor: IsActive===true || (mainItemContainer.isGroupParent && mainItemContainer.hasShown)? + basicColor: IsActive===true || (taskItem.isGroupParent && taskItem.hasShown)? glowFrame.isActiveColor : glowFrame.notActiveColor glow3D: root.glow3D @@ -74,27 +74,27 @@ Item{ attentionColor: colorScopePalette.negativeTextColor roundCorners: true - showAttention: mainItemContainer.showAttention + showAttention: taskItem.showAttention showGlow: { if (root.showGlow && (root.glowOption === Latte.Types.GlowAll || showAttention )) return true; - else if (root.showGlow && root.glowOption === Latte.Types.GlowOnlyOnActive && mainItemContainer.hasActive) + else if (root.showGlow && root.glowOption === Latte.Types.GlowOnlyOnActive && taskItem.hasActive) return true; else return false; } showBorder: root.showGlow && root.glow3D - // opacity: (!mainItemContainer.hasActive && root.showPreviews - // && windowsPreviewDlg.activeItem && (windowsPreviewDlg.activeItem === mainItemContainer)) ? 0.4 : 1 + // opacity: (!taskItem.hasActive && root.showPreviews + // && windowsPreviewDlg.activeItem && (windowsPreviewDlg.activeItem === taskItem)) ? 0.4 : 1 - property int stateWidth: mainItemContainer.isGroupParent ? (wrapper.regulatorWidth - secondPoint.width) : wrapper.regulatorWidth - spacer.width - property int stateHeight: mainItemContainer.isGroupParent ? wrapper.regulatorHeight - secondPoint.height : wrapper.regulatorHeight - spacer.height + property int stateWidth: taskItem.isGroupParent ? (wrapper.regulatorWidth - secondPoint.width) : wrapper.regulatorWidth - spacer.width + property int stateHeight: taskItem.isGroupParent ? wrapper.regulatorHeight - secondPoint.height : wrapper.regulatorHeight - spacer.height property int animationTime: root.durationTime* (0.7*units.longDuration) - property bool isActive: mainItemContainer.hasActive - || (root.showPreviews && windowsPreviewDlg.activeItem && (windowsPreviewDlg.activeItem === mainItemContainer)) + property bool isActive: taskItem.hasActive + || (root.showPreviews && windowsPreviewDlg.activeItem && (windowsPreviewDlg.activeItem === taskItem)) property bool vertical: root.vertical @@ -121,7 +121,7 @@ Item{ onIsActiveChanged: { - // if(mainItemContainer.hasActive || windowsPreviewDlg.visible) + // if(taskItem.hasActive || windowsPreviewDlg.visible) if (root.activeIndicatorType === Latte.Types.LineIndicator) activeAndReverseAnimation.start(); } @@ -161,8 +161,8 @@ Item{ id: activeAndReverseAnimation target: firstPoint property: root.vertical ? "height" : "width" - to: (mainItemContainer.hasActive && root.activeIndicatorType === Latte.Types.LineIndicator) - || (root.showPreviews && windowsPreviewDlg.activeItem && (windowsPreviewDlg.activeItem === mainItemContainer)) + to: (taskItem.hasActive && root.activeIndicatorType === Latte.Types.LineIndicator) + || (root.showPreviews && windowsPreviewDlg.activeItem && (windowsPreviewDlg.activeItem === taskItem)) ? (root.vertical ? firstPoint.stateHeight : firstPoint.stateWidth) : glowFrame.size duration: firstPoint.animationTime easing.type: Easing.InQuad @@ -189,17 +189,17 @@ Item{ contrastColor: root.appShadowColorSolid showBorder: root.showGlow && root.glow3D - basicColor: state2Color //mainItemContainer.hasActive ? state2Color : state1Color + basicColor: state2Color //taskItem.hasActive ? state2Color : state1Color roundCorners: true showGlow: root.showGlow && root.glowOption === Latte.Types.GlowAll - visible: ( mainItemContainer.isGroupParent && ((root.dotsOnActive && root.activeIndicatorType === Latte.Types.LineIndicator) + visible: ( taskItem.isGroupParent && ((root.dotsOnActive && root.activeIndicatorType === Latte.Types.LineIndicator) || root.activeIndicatorType === Latte.Types.DotIndicator - || !mainItemContainer.hasActive) )? true: false + || !taskItem.hasActive) )? true: false //when there is no active window - property color state1Color: mainItemContainer.hasShown ? glowFrame.isActiveColor : glowFrame.minimizedColor + property color state1Color: taskItem.hasShown ? glowFrame.isActiveColor : glowFrame.minimizedColor //when there is active window - property color state2Color: mainItemContainer.hasMinimized ? glowFrame.minimizedColor : glowFrame.isActiveColor + property color state2Color: taskItem.hasMinimized ? glowFrame.minimizedColor : glowFrame.isActiveColor } } } diff --git a/plasmoid/package/contents/ui/task/HiddenSpacer.qml b/plasmoid/package/contents/ui/task/HiddenSpacer.qml index 88edaec34..54bfa9340 100644 --- a/plasmoid/package/contents/ui/task/HiddenSpacer.qml +++ b/plasmoid/package/contents/ui/task/HiddenSpacer.qml @@ -29,8 +29,8 @@ Item{ height: root.vertical ? nHiddenSize : wrapper.height visible: (rightSpacer ? index === parabolicManager.lastRealTaskIndex : index === parabolicManager.firstRealTaskIndex) - || (separatorSpace > 0) || mainItemContainer.inAttentionAnimation - || mainItemContainer.inFastRestoreAnimation || mainItemContainer.inMimicParabolicAnimation + || (separatorSpace > 0) || taskItem.inAttentionAnimation + || taskItem.inFastRestoreAnimation || taskItem.inMimicParabolicAnimation property bool neighbourSeparator: false //in case there is a neighbour separator, lastValidIndex is used in order to protect from false @@ -61,7 +61,7 @@ Item{ if (isForcedHidden) { return 0; } else if (!inAttentionAnimation && !inMimicParabolicAnimation && !inFastRestoreAnimation) { - return (nScale > 0) ? (mainItemContainer.spacersMaxSize * nScale) + separatorSpace : separatorSpace; + return (nScale > 0) ? (taskItem.spacersMaxSize * nScale) + separatorSpace : separatorSpace; } else { return (nScale > 0) ? (root.iconSize * nScale) + separatorSpace : separatorSpace; } @@ -70,7 +70,7 @@ Item{ function updateNeighbour() { //index===-1 indicates that this item is removed - if (mainItemContainer.inBouncingAnimation) { + if (taskItem.inBouncingAnimation) { return; } @@ -78,14 +78,14 @@ Item{ neighbourSeparator = false; } else if (latteView && index!==-1) { if (!rightSpacer) { - neighbourSeparator = (mainItemContainer.hasNeighbourSeparator(itemIndex-1, false) && !isSeparator && itemIndex!==parabolicManager.firstRealTaskIndex) + neighbourSeparator = (taskItem.hasNeighbourSeparator(itemIndex-1, false) && !isSeparator && itemIndex!==parabolicManager.firstRealTaskIndex) || (latteView.parabolicManager.isSeparator(latteView.latteAppletPos-1) && parabolicManager.firstRealTaskIndex === itemIndex); } else { if (itemIndex >= root.tasksCount) { return; } - neighbourSeparator = (mainItemContainer.hasNeighbourSeparator(itemIndex+1,true) && !isSeparator && itemIndex!==parabolicManager.lastRealTaskIndex) + neighbourSeparator = (taskItem.hasNeighbourSeparator(itemIndex+1,true) && !isSeparator && itemIndex!==parabolicManager.lastRealTaskIndex) || (latteView.parabolicManager.isSeparator(latteView.latteAppletPos+1) && parabolicManager.lastRealTaskIndex === itemIndex ); } @@ -120,7 +120,7 @@ Item{ } Connections{ - target: mainItemContainer + target: taskItem onItemIndexChanged: hiddenSpacer.updateNeighbour(); } @@ -135,10 +135,10 @@ Item{ Behavior on nHiddenSize { id: animatedBehavior - enabled: (mainItemContainer.inFastRestoreAnimation || showWindowAnimation.running || restoreAnimation.running - || root.inActivityChange || mainItemContainer.inRemoveStage) - || (mainItemContainer.containsMouse && inAttentionAnimation && wrapper.mScale!==root.zoomFactor) - NumberAnimation{ duration: 3 * mainItemContainer.animationTime } + enabled: (taskItem.inFastRestoreAnimation || showWindowAnimation.running || restoreAnimation.running + || root.inActivityChange || taskItem.inRemoveStage) + || (taskItem.containsMouse && inAttentionAnimation && wrapper.mScale!==root.zoomFactor) + NumberAnimation{ duration: 3 * taskItem.animationTime } } Behavior on nHiddenSize { diff --git a/plasmoid/package/contents/ui/task/IconItem.qml b/plasmoid/package/contents/ui/task/IconItem.qml index abf1fafed..cf8760c3d 100644 --- a/plasmoid/package/contents/ui/task/IconItem.qml +++ b/plasmoid/package/contents/ui/task/IconItem.qml @@ -61,7 +61,7 @@ Item{ property int shadowSize : root.appShadowSize - readonly property bool smartLauncherEnabled: ((mainItemContainer.isStartup === false) && (root.smartLaunchersEnabled)) + readonly property bool smartLauncherEnabled: ((taskItem.isStartup === false) && (root.smartLaunchersEnabled)) readonly property variant iconDecoration: decoration property QtObject buffers: null property QtObject smartLauncherItem: null @@ -82,7 +82,7 @@ Item{ " import org.kde.plasma.private.taskmanager 0.1 as TaskManagerApplet; TaskManagerApplet.SmartLauncherItem { }", centralItem); - smartLauncher.launcherUrl = Qt.binding(function() { return mainItemContainer.launcherUrlWithIcon; }); + smartLauncher.launcherUrl = Qt.binding(function() { return taskItem.launcherUrlWithIcon; }); smartLauncherItem = smartLauncher; } else if (!smartLauncherEnabled && smartLauncherItem) { @@ -93,8 +93,8 @@ Item{ Rectangle{ id: draggedRectangle - width: mainItemContainer.isSeparator ? parent.width + 1 : iconImageBuffer.width+1 - height: mainItemContainer.isSeparator ? parent.height + 1 : iconImageBuffer.height+1 + width: taskItem.isSeparator ? parent.width + 1 : iconImageBuffer.width+1 + height: taskItem.isSeparator ? parent.height + 1 : iconImageBuffer.height+1 anchors.centerIn: iconGraphic opacity: 0 radius: 3 @@ -134,7 +134,7 @@ Item{ target: plasmoid onFormFactorChanged:{ - mainItemContainer.inAddRemoveAnimation = false; + taskItem.inAddRemoveAnimation = false; wrapper.mScale = 1.01; wrapper.tempScaleWidth = 1.01; @@ -186,7 +186,7 @@ Item{ height: Math.round(width) source: decoration - visible: !mainItemContainer.isSeparator && !badgesLoader.active + visible: !taskItem.isSeparator && !badgesLoader.active //visible: !root.enableShadows onValidChanged: { @@ -198,9 +198,9 @@ Item{ //! try to show the correct icon when a window is removed... libtaskmanager when a window is removed //! sends an unknown pixmap as icon Connections { - target: mainItemContainer + target: taskItem onInRemoveStageChanged: { - if (mainItemContainer.inRemoveStage && iconImageBuffer.lastValidSourceName !== "") { + if (taskItem.inRemoveStage && iconImageBuffer.lastValidSourceName !== "") { iconImageBuffer.source = iconImageBuffer.lastValidSourceName; } } @@ -224,7 +224,7 @@ Item{ states: [ State{ name: "*" - when: !launcherAnimation.running && !newWindowAnimation.running && !mainItemContainer.inAddRemoveAnimation && !fastRestoreAnimation.running + when: !launcherAnimation.running && !newWindowAnimation.running && !taskItem.inAddRemoveAnimation && !fastRestoreAnimation.running AnchorChanges{ target:iconImageBuffer; @@ -239,7 +239,7 @@ Item{ State{ name: "inAddRemoveAnimation" - when: mainItemContainer.inAddRemoveAnimation + when: taskItem.inAddRemoveAnimation AnchorChanges{ target:iconImageBuffer; @@ -254,7 +254,7 @@ Item{ State{ name: "animating" - when: (launcherAnimation.running || newWindowAnimation.running || fastRestoreAnimation.running) && !mainItemContainer.inAddRemoveAnimation + when: (launcherAnimation.running || newWindowAnimation.running || fastRestoreAnimation.running) && !taskItem.inAddRemoveAnimation AnchorChanges{ target:iconImageBuffer; @@ -273,7 +273,7 @@ Item{ Transition{ from: "animating" to: "*" - enabled: !fastRestoreAnimation.running && !mainItemContainer.inMimicParabolicAnimation + enabled: !fastRestoreAnimation.running && !taskItem.inMimicParabolicAnimation AnchorAnimation { duration: 1.5*root.durationTime*units.longDuration } } @@ -289,12 +289,12 @@ Item{ property real opacityN: showProgress || showAudio ? 1 : 0 - property bool showProgress: (centralItem.smartLauncherEnabled && centralItem.smartLauncherItem && !mainItemContainer.isSeparator + property bool showProgress: (centralItem.smartLauncherEnabled && centralItem.smartLauncherItem && !taskItem.isSeparator && (centralItem.smartLauncherItem.countVisible || centralItem.smartLauncherItem.progressVisible - || mainItemContainer.badgeIndicator > 0)) + || taskItem.badgeIndicator > 0)) - property bool showAudio: mainItemContainer.hasAudioStream && mainItemContainer.playingAudio && - !mainItemContainer.isSeparator + property bool showAudio: taskItem.hasAudioStream && taskItem.playingAudio && + !taskItem.isSeparator Behavior on opacityN { NumberAnimation { duration: root.durationTime*2*units.longDuration } @@ -462,7 +462,7 @@ Item{ Component.onCompleted: fixedIndex = parabolicManager.pseudoTaskIndex(index+1); - property real isValidDelayer: root.showTasksNumbers && !mainItemContainer.isSeparator && fixedIndex<20 ? 1 : 0 + property real isValidDelayer: root.showTasksNumbers && !taskItem.isSeparator && fixedIndex<20 ? 1 : 0 Behavior on isValidDelayer { NumberAnimation { duration: root.durationTime*units.longDuration } @@ -528,12 +528,12 @@ Item{ visible: opacity == 0 ? false : true opacity: root.dropNewLauncher && !mouseHandler.onlyLaunchers - && (root.dragSource == null) && (mouseHandler.hoveredItem === mainItemContainer) ? 1 : 0 + && (root.dragSource == null) && (mouseHandler.hoveredItem === taskItem) ? 1 : 0 } BrightnessContrast{ id:hoveredImage - opacity: mainItemContainer.containsMouse && !clickedAnimation.running ? 1 : 0 + opacity: taskItem.containsMouse && !clickedAnimation.running ? 1 : 0 anchors.fill: iconGraphic brightness: 0.30 @@ -579,10 +579,10 @@ Item{ } Connections{ - target: mainItemContainer + target: taskItem onShowAttentionChanged:{ - if (!mainItemContainer.showAttention && newWindowAnimation.running && mainItemContainer.inAttentionAnimation) { + if (!taskItem.showAttention && newWindowAnimation.running && taskItem.inAttentionAnimation) { newWindowAnimation.pause(); fastRestoreAnimation.start(); } @@ -605,12 +605,12 @@ Item{ states: [ State{ name: "*" - when: !mainItemContainer.isDragged + when: !taskItem.isDragged }, State{ name: "isDragged" - when: ( (mainItemContainer.isDragged) && (!root.editMode) ) + when: ( (taskItem.isDragged) && (!root.editMode) ) } ] @@ -630,7 +630,7 @@ Item{ latteView.globalDirectRender=false; } - mainItemContainer.inBlockingAnimation = true; + taskItem.inBlockingAnimation = true; root.clearZoom(); } } @@ -663,7 +663,7 @@ Item{ PropertyAnimation { target: stateColorizer property: "opacity" - to: mainItemContainer.isSeparator ? 0 : 1 + to: taskItem.isSeparator ? 0 : 1 duration: isDraggedTransition.speed easing.type: Easing.OutQuad } @@ -672,7 +672,7 @@ Item{ onRunningChanged: { if(running){ - mainItemContainer.animationStarted(); + taskItem.animationStarted(); //root.animations++; parabolicManager.clearTasksGreaterThan(index); @@ -737,7 +737,7 @@ Item{ ScriptAction{ script: { - mainItemContainer.inBlockingAnimation = false; + taskItem.inBlockingAnimation = false; } } } @@ -748,7 +748,7 @@ Item{ wrapper.calculateScales((root.iconSize+root.iconMargin)/2); - mainItemContainer.animationEnded(); + taskItem.animationEnded(); // root.animations--; } } diff --git a/plasmoid/package/contents/ui/task/ProgressOverlay.qml b/plasmoid/package/contents/ui/task/ProgressOverlay.qml index e5cf5e3ea..5701fb42c 100644 --- a/plasmoid/package/contents/ui/task/ProgressOverlay.qml +++ b/plasmoid/package/contents/ui/task/ProgressOverlay.qml @@ -61,16 +61,16 @@ Item { border.color: root.minimizedDotColor minimumWidth: 0.8 * parent.height height: 0.8 * parent.height - numberValue: mainItemContainer.badgeIndicator > 0 ? mainItemContainer.badgeIndicator : centralItem.smartLauncherItem.count + numberValue: taskItem.badgeIndicator > 0 ? taskItem.badgeIndicator : centralItem.smartLauncherItem.count fullCircle: true showNumber: true - textWithBackgroundColor: ( (mainItemContainer.badgeIndicator > 0) + textWithBackgroundColor: ( (taskItem.badgeIndicator > 0) || (centralItem.smartLauncherItem.countVisible && !centralItem.smartLauncherItem.progressVisible) ) && proportion>0 proportion: { - if (mainItemContainer.badgeIndicator > 0 || + if (taskItem.badgeIndicator > 0 || (centralItem.smartLauncherItem.countVisible && !centralItem.smartLauncherItem.progressVisible)) { return 100; } diff --git a/plasmoid/package/contents/ui/task/SubWindows.qml b/plasmoid/package/contents/ui/task/SubWindows.qml index a5a0193e1..09227a11f 100644 --- a/plasmoid/package/contents/ui/task/SubWindows.qml +++ b/plasmoid/package/contents/ui/task/SubWindows.qml @@ -72,13 +72,13 @@ Item{ } Component.onCompleted: { - rootIndex = mainItemContainer.modelIndex(); + rootIndex = taskItem.modelIndex(); } } } Connections{ - target: mainItemContainer + target: taskItem onItemIndexChanged: windowsContainer.updateStates(); } @@ -105,7 +105,7 @@ Item{ } function initializeStates(){ - windowsLocalModel.rootIndex = mainItemContainer.modelIndex(); + windowsLocalModel.rootIndex = taskItem.modelIndex(); hasMinimized = false; hasShown = false; @@ -115,10 +115,10 @@ Item{ checkInternalStates(); } else{ - if(mainItemContainer.isActive) + if(taskItem.isActive) hasActive = true; - if(mainItemContainer.isMinimized){ + if(taskItem.isMinimized){ hasMinimized = true; } else { hasShown = true; @@ -143,7 +143,7 @@ Item{ } function windowsTitles() { - windowsLocalModel.rootIndex = mainItemContainer.modelIndex(); + windowsLocalModel.rootIndex = taskItem.modelIndex(); var result = new Array; var childs = windowsLocalModel.items; @@ -160,9 +160,9 @@ Item{ //! function which is used to cycle activation into //! a group of windows function activateNextTask() { - windowsLocalModel.rootIndex = mainItemContainer.modelIndex(); + windowsLocalModel.rootIndex = taskItem.modelIndex(); - if (!mainItemContainer.isGroupParent) { + if (!taskItem.isGroupParent) { return; } @@ -204,9 +204,9 @@ Item{ //! function which is used to cycle activation into //! a group of windows backwise function activatePreviousTask() { - windowsLocalModel.rootIndex = mainItemContainer.modelIndex(); + windowsLocalModel.rootIndex = taskItem.modelIndex(); - if (!mainItemContainer.isGroupParent) { + if (!taskItem.isGroupParent) { return; } @@ -247,10 +247,10 @@ Item{ } Component.onCompleted: { - mainItemContainer.checkWindowsStates.connect(initializeStates); + taskItem.checkWindowsStates.connect(initializeStates); } Component.onDestruction: { - mainItemContainer.checkWindowsStates.disconnect(initializeStates); + taskItem.checkWindowsStates.disconnect(initializeStates); } } diff --git a/plasmoid/package/contents/ui/task/TaskItem.qml b/plasmoid/package/contents/ui/task/TaskItem.qml index fe8c7b4ab..a8f1dc1aa 100644 --- a/plasmoid/package/contents/ui/task/TaskItem.qml +++ b/plasmoid/package/contents/ui/task/TaskItem.qml @@ -33,7 +33,7 @@ import org.kde.latte 0.2 as Latte import "animations" as TaskAnimations MouseArea{ - id: mainItemContainer + id: taskItem visible: false //true//(isStartup && root.durationTime !== 0) ? false : true @@ -122,7 +122,7 @@ MouseArea{ property bool isZoomed: false property bool canPublishGeometries: (isWindow || isStartup || isGroupParent) && visible && width>=root.iconSize && height>=root.iconSize - && !mainItemContainer.delayingRemove + && !taskItem.delayingRemove && (wrapper.mScale===1 || wrapper.mScale===root.zoomFactor) //don't publish during zoomFactor property bool pressed: false @@ -237,18 +237,18 @@ MouseArea{ } if ((windowsCount >= 2) && (windowsCount > previousCount) - && !(mainItemContainer.containsMouse || parabolicManager.neighbourIsHovered(itemIndex)) ){ + && !(taskItem.containsMouse || parabolicManager.neighbourIsHovered(itemIndex)) ){ if(root.dragSource == null) - mainItemContainer.groupWindowAdded(); + taskItem.groupWindowAdded(); } else if ((windowsCount >=1) &&(windowsCount < previousCount)){ //sometimes this is triggered in dragging with no reason - if(root.dragSource == null && !mainItemContainer.delayingRemove) - mainItemContainer.groupWindowRemoved(); + if(root.dragSource == null && !taskItem.delayingRemove) + taskItem.groupWindowRemoved(); } if (windowsCount>=1) { - mainItemContainer.slotPublishGeometries(); + taskItem.slotPublishGeometries(); } previousCount = windowsCount; @@ -259,11 +259,11 @@ MouseArea{ id: isSeparatorRectangle active: (opacityN>0) - width: mainItemContainer.width - height: mainItemContainer.height + width: taskItem.width + height: taskItem.height anchors.centerIn: separatorItem - property real opacityN: isSeparator && root.contextMenu && root.contextMenu.visualParent === mainItemContainer ? 1 : 0 + property real opacityN: isSeparator && root.contextMenu && root.contextMenu.visualParent === taskItem ? 1 : 0 Behavior on opacityN { NumberAnimation { duration: root.durationTime*units.longDuration } @@ -301,7 +301,7 @@ MouseArea{ //opacity: separatorShadow.active || root.internalSeparatorHidden ? 0 : 0.4 opacity: separatorShadow.active || forceHiddenState ? 0 : 0.4 - visible: mainItemContainer.isSeparator + visible: taskItem.isSeparator width: root.vertical ? root.iconSize : (root.dragSource || root.editMode) ? 5+root.iconMargin: 1 height: !root.vertical ? root.iconSize : (root.dragSource || root.editMode) ? 5+root.iconMargin: 1 @@ -319,7 +319,7 @@ MouseArea{ forceHiddenState = false; } else { var firstPosition = (index>=0) && (index < parabolicManager.firstRealTaskIndex); - var sepNeighbour = mainItemContainer.hasNeighbourSeparator(index-1, false); + var sepNeighbour = taskItem.hasNeighbourSeparator(index-1, false); var firstSepFromLastSeparatorsGroup = (index>=0) && (index > parabolicManager.lastRealTaskIndex); forceHiddenState = (firstPosition || sepNeighbour || firstSepFromLastSeparatorsGroup); @@ -348,11 +348,11 @@ MouseArea{ //! place we might miss the activation of the parabolic effect. //! By catching that signal we are trying to solve this. onDockIsShownCompletelyChanged: { - if (dockIsShownCompletely && mainItemContainer.containsMouse) { + if (dockIsShownCompletely && taskItem.containsMouse) { if (root.vertical) { - mainItemContainer.mousePosChanged(mainItemContainer.mouseY); + taskItem.mousePosChanged(taskItem.mouseY); } else { - mainItemContainer.mousePosChanged(mainItemContainer.mouseX); + taskItem.mousePosChanged(taskItem.mouseX); } } } @@ -369,12 +369,12 @@ MouseArea{ return; } - mainItemContainer.updateVisibilityBasedOnLaunchers(); + taskItem.updateVisibilityBasedOnLaunchers(); } onInActivityChangeChanged: { if (root.showWindowsOnlyFromLaunchers && !root.inActivityChange) { - mainItemContainer.updateVisibilityBasedOnLaunchers(); + taskItem.updateVisibilityBasedOnLaunchers(); } } } @@ -455,7 +455,7 @@ MouseArea{ repeat: false onTriggered: { - // mainItemContainer.hoverEnabled = true; + // taskItem.hoverEnabled = true; slotPublishGeometries(); if (latteView && latteView.debugModeTimers) { @@ -482,7 +482,7 @@ MouseArea{ onCanPublishGeometriesChanged: { if (canPublishGeometries) { slotPublishGeometries(); - taskInitComponent.createObject(mainItemContainer); + taskInitComponent.createObject(taskItem); } } @@ -523,8 +523,8 @@ MouseArea{ onIsDraggedChanged: { if(isDragged && (!root.editMode)){ - root.dragSource = mainItemContainer; - dragHelper.startDrag(mainItemContainer, model.MimeType, model.MimeData, + root.dragSource = taskItem; + dragHelper.startDrag(taskItem, model.MimeType, model.MimeData, model.LauncherUrlWithoutIcon, model.decoration); pressX = -1; pressY = -1; @@ -612,13 +612,13 @@ MouseArea{ // IMPORTANT: This must be improved ! even for small milliseconds it reduces performance onExited: { - mainItemContainer.scalesUpdatedOnce = false; + taskItem.scalesUpdatedOnce = false; if (root.latteView && (!root.showPreviews || (root.showPreviews && isLauncher))){ root.latteView.hideTooltipLabel(); } - if(mainItemContainer.contextMenu && mainItemContainer.contextMenu.status == PlasmaComponents.DialogStatus.Open){ + if(taskItem.contextMenu && taskItem.contextMenu.status == PlasmaComponents.DialogStatus.Open){ ///don't check to restore zooms } else{ @@ -649,7 +649,7 @@ MouseArea{ } //! show previews - if(root.showPreviews && !windowsPreviewDlg.visible && windowsPreviewDlg.activeItem !== mainItemContainer){ + if(root.showPreviews && !windowsPreviewDlg.visible && windowsPreviewDlg.activeItem !== taskItem){ if (hoveredTimerObj) { //! don't delay showing preview in normal states, //! that is when the dock wasn't hidden @@ -658,7 +658,7 @@ MouseArea{ } } else { if (!root.disableAllWindowsFunctionality) { - hoveredTimerObj = hoveredTimerComponent.createObject(mainItemContainer); + hoveredTimerObj = hoveredTimerComponent.createObject(taskItem); } } } @@ -718,8 +718,8 @@ MouseArea{ && isDragged && !root.editMode && dragHelper.isDrag(pressX, pressY, mouse.x, mouse.y) ) { - root.dragSource = mainItemContainer; - dragHelper.startDrag(mainItemContainer, model.MimeType, model.MimeData, + root.dragSource = taskItem; + dragHelper.startDrag(taskItem, model.MimeType, model.MimeData, model.LauncherUrlWithoutIcon, model.decoration); pressX = -1; pressY = -1; @@ -743,7 +743,7 @@ MouseArea{ hoveredTimerObj.restart(); } else { if (!root.disableAllWindowsFunctionality) { - hoveredTimerObj = hoveredTimerComponent.createObject(mainItemContainer); + hoveredTimerObj = hoveredTimerComponent.createObject(taskItem); } } } @@ -778,7 +778,7 @@ MouseArea{ pressY = mouse.y; if(draggingResistaner == null && !modAccepted) - draggingResistaner = resistanerTimerComponent.createObject(mainItemContainer); + draggingResistaner = resistanerTimerComponent.createObject(taskItem); } else if (mouse.button == Qt.RightButton && !modAccepted){ // When we're a launcher, there's no window controls, so we can show all @@ -789,7 +789,7 @@ MouseArea{ showContextMenu(); } - //root.createContextMenu(mainItemContainer).show(); + //root.createContextMenu(taskItem).show(); } if (hoveredTimerObj){ @@ -809,7 +809,7 @@ MouseArea{ if(pressed && (!inBlockingAnimation || inAttentionAnimation) && !isSeparator){ if (modifierAccepted(mouse) && !root.disableAllWindowsFunctionality){ - if( !mainItemContainer.isLauncher){ + if( !taskItem.isLauncher){ if (root.modifierClickAction == Latte.Types.NewInstance) { tasksModel.requestNewInstance(modelIndex()); } else if (root.modifierClickAction == Latte.Types.Close) { @@ -828,7 +828,7 @@ MouseArea{ activateTask(); } } else if (mouse.button == Qt.MidButton && !root.disableAllWindowsFunctionality){ - if( !mainItemContainer.isLauncher){ + if( !taskItem.isLauncher){ if (root.middleClickAction == Latte.Types.NewInstance) { tasksModel.requestNewInstance(modelIndex()); } else if (root.middleClickAction == Latte.Types.Close) { @@ -847,7 +847,7 @@ MouseArea{ activateTask(); } } else if (mouse.button == Qt.LeftButton){ - if( !mainItemContainer.isLauncher){ + if( !taskItem.isLauncher){ if (root.leftClickAction === Latte.Types.PresentWindows) { activateTask(); } else if (root.leftClickAction === Latte.Types.CycleThroughTasks) { @@ -856,7 +856,7 @@ MouseArea{ else activateTask(); } else if (root.leftClickAction === Latte.Types.PreviewWindows) { - if(windowsPreviewDlg.activeItem !== mainItemContainer){ + if(windowsPreviewDlg.activeItem !== taskItem){ showPreviewWindow(); } else { hidePreviewWindow(); @@ -935,7 +935,7 @@ MouseArea{ interval: 400 - onTriggered: mainItemContainer.blockWheel = false; + onTriggered: taskItem.blockWheel = false; } ///////////////// End Of Mouse Area Events /////////////////// @@ -973,7 +973,7 @@ MouseArea{ } function activateTask() { - if( mainItemContainer.isLauncher || root.disableAllWindowsFunctionality){ + if( taskItem.isLauncher || root.disableAllWindowsFunctionality){ if (Latte.WindowSystem.compositingActive) { wrapper.runLauncherAnimation(); } else { @@ -989,7 +989,7 @@ MouseArea{ windowsPreviewDlg.hide(3); } else { preparePreviewWindow(false); - windowsPreviewDlg.show(mainItemContainer); + windowsPreviewDlg.show(taskItem); } } } else { @@ -1022,15 +1022,15 @@ MouseArea{ return; } - if(windowsPreviewDlg.activeItem !== mainItemContainer){ + if(windowsPreviewDlg.activeItem !== taskItem){ if (!root.latteView || (root.latteView && !root.latteView.isHalfShown && !root.latteView.inSlidingIn && !root.latteView.inSlidingOut)) { if (root.latteView && root.titleTooltips) { root.latteView.hideTooltipLabel(); } - mainItemContainer.preparePreviewWindow(false); - windowsPreviewDlg.show(mainItemContainer); + taskItem.preparePreviewWindow(false); + windowsPreviewDlg.show(taskItem); } } } @@ -1042,12 +1042,12 @@ MouseArea{ var fixedDisplayText = displayText.length>maxCharacters ? displayText.substring(0,maxCharacters-1) + "..." : displayText; - root.latteView.showTooltipLabel(mainItemContainer, fixedDisplayText); + root.latteView.showTooltipLabel(taskItem, fixedDisplayText); } } function hidePreviewWindow() { - if(windowsPreviewDlg.activeItem === mainItemContainer){ + if(windowsPreviewDlg.activeItem === taskItem){ windowsPreviewDlg.hide("14.1"); if (root.latteView && root.titleTooltips && containsMouse) { @@ -1059,7 +1059,7 @@ MouseArea{ function preparePreviewWindow(hideClose){ windowsPreviewDlg.visualParent = previewsVisualParent; - toolTipDelegate.parentTask = mainItemContainer; + toolTipDelegate.parentTask = taskItem; toolTipDelegate.rootIndex = tasksModel.makeModelIndex(itemIndex, -1); toolTipDelegate.hideCloseButtons = hideClose; @@ -1116,7 +1116,7 @@ MouseArea{ // if ((lastButtonClicked == Qt.LeftButton)||(lastButtonClicked == Qt.MidButton)){ if (Latte.WindowSystem.compositingActive) { inBouncingAnimation = true; - root.addWaitingLauncher(mainItemContainer.launcherUrl); + root.addWaitingLauncher(taskItem.launcherUrl); } if (root.disableAllWindowsFunctionality) { @@ -1184,7 +1184,7 @@ MouseArea{ return; if (!root.contextMenu) { - contextMenu = root.createContextMenu(mainItemContainer, modelIndex(), args); + contextMenu = root.createContextMenu(taskItem, modelIndex(), args); contextMenu.show(); } else { //! make sure that context menu isnt deleted multiple times and creates a crash @@ -1221,9 +1221,9 @@ MouseArea{ } function slotShowPreviewForTasks(group) { - if (group === mainItemContainer && !windowsPreviewDlg.visible) { + if (group === taskItem && !windowsPreviewDlg.visible) { preparePreviewWindow(true); - windowsPreviewDlg.show(mainItemContainer); + windowsPreviewDlg.show(taskItem); } } @@ -1234,17 +1234,17 @@ MouseArea{ && (!latteView || (latteView && currentLayout && latteView.universalLayoutManager && currentLayout.name === latteView.universalLayoutManager.currentLayoutName))) { - var globalChoords = backend.globalRect(mainItemContainer); + var globalChoords = backend.globalRect(taskItem); //! Magic Lamp effect doesn't like coordinates outside the screen and //! width,heights of zero value... So we now normalize the geometries //! sent in order to avoid such circumstances if (root.vertical) { globalChoords.width = 1; - globalChoords.height = Math.max(root.iconSize, mainItemContainer.height); + globalChoords.height = Math.max(root.iconSize, taskItem.height); } else { globalChoords.height = 1; - globalChoords.width = Math.max(root.iconSize, mainItemContainer.width); + globalChoords.width = Math.max(root.iconSize, taskItem.width); } if (root.position === PlasmaCore.Types.BottomPositioned) { @@ -1257,7 +1257,7 @@ MouseArea{ globalChoords.x = plasmoid.screenGeometry.x+plasmoid.screenGeometry.width - 1; } - tasksModel.requestPublishDelegateGeometry(mainItemContainer.modelIndex(), globalChoords, mainItemContainer); + tasksModel.requestPublishDelegateGeometry(taskItem.modelIndex(), globalChoords, taskItem); } } @@ -1281,17 +1281,17 @@ MouseArea{ return; } - var streams = pa.streamsForPid(mainItemContainer.pid); + var streams = pa.streamsForPid(taskItem.pid); if (streams.length) { - pa.registerPidMatch(mainItemContainer.appName); + pa.registerPidMatch(taskItem.appName); } else { // We only want to fall back to appName matching if we never managed to map // a PID to an audio stream window. Otherwise if you have two instances of // an application, one playing and the other not, it will look up appName // for the non-playing instance and erroneously show an indicator on both. - if (!pa.hasPidMatch(mainItemContainer.appName)) { + if (!pa.hasPidMatch(taskItem.appName)) { var streams_result; - streams_result = pa.streamsForAppName(mainItemContainer.appName); + streams_result = pa.streamsForAppName(taskItem.appName); if (streams_result.length===0 && launcherName !== "") { streams_result = pa.streamsForAppName(launcherName); } @@ -1315,7 +1315,7 @@ MouseArea{ } if (changed) { - mainItemContainer.audioStreams = streams; + taskItem.audioStreams = streams; } } @@ -1326,22 +1326,22 @@ MouseArea{ } function updateVisibilityBasedOnLaunchers(){ - var launcherExists = !(((tasksModel.launcherPosition(mainItemContainer.launcherUrl) == -1) - && (tasksModel.launcherPosition(mainItemContainer.launcherUrlWithIcon) == -1) ) - || !tasksModel.launcherInCurrentActivity(mainItemContainer.launcherUrl)); + var launcherExists = !(((tasksModel.launcherPosition(taskItem.launcherUrl) == -1) + && (tasksModel.launcherPosition(taskItem.launcherUrlWithIcon) == -1) ) + || !tasksModel.launcherInCurrentActivity(taskItem.launcherUrl)); if (root.showWindowsOnlyFromLaunchers) { - var hideWindow = !launcherExists && mainItemContainer.isWindow; + var hideWindow = !launcherExists && taskItem.isWindow; if (hideWindow) { isForcedHidden = true; taskRealRemovalAnimation.start(); - } else if (launcherExists && mainItemContainer.isWindow && !mainItemContainer.isVisible) { + } else if (launcherExists && taskItem.isWindow && !taskItem.isVisible) { showWindowAnimation.showWindow(); isForcedHidden = false; } } else { - var showWindow = !launcherExists && mainItemContainer.isWindow; + var showWindow = !launcherExists && taskItem.isWindow; if (showWindow) { showWindowAnimation.showWindow(); @@ -1352,18 +1352,18 @@ MouseArea{ function toggleMuted() { if (muted) { - mainItemContainer.audioStreams.forEach(function (item) { item.unmute(); }); + taskItem.audioStreams.forEach(function (item) { item.unmute(); }); } else { - mainItemContainer.audioStreams.forEach(function (item) { item.mute(); }); + taskItem.audioStreams.forEach(function (item) { item.mute(); }); } } function increaseVolume() { - mainItemContainer.audioStreams.forEach(function (item) { item.increaseVolume(); }); + taskItem.audioStreams.forEach(function (item) { item.increaseVolume(); }); } function decreaseVolume() { - mainItemContainer.audioStreams.forEach(function (item) { item.decreaseVolume(); }); + taskItem.audioStreams.forEach(function (item) { item.decreaseVolume(); }); } function updateBadge() { @@ -1379,15 +1379,15 @@ MouseArea{ Connections { target: pulseAudio.item ignoreUnknownSignals: true // Plasma-PA might not be available - onStreamsChanged: mainItemContainer.updateAudioStreams() + onStreamsChanged: taskItem.updateAudioStreams() } Connections { target: root //trying to fix #440, showing the audio icon indicator to irrelevant tasks //after dragging an existent task with audio - onDragSourceChanged: mainItemContainer.updateAudioStreams() - onIndicateAudioStreamsChanged: mainItemContainer.updateAudioStreams() + onDragSourceChanged: taskItem.updateAudioStreams() + onIndicateAudioStreamsChanged: taskItem.updateAudioStreams() } Connections { @@ -1416,12 +1416,12 @@ MouseArea{ root.mimicEnterForParabolic.connect(slotMimicEnterForParabolic); root.launchersUpdatedFor.connect(slotLaunchersChangedFor); - var hasShownLauncher = ((tasksModel.launcherPosition(mainItemContainer.launcherUrl) !== -1) - || (tasksModel.launcherPosition(mainItemContainer.launcherUrlWithIcon) !== -1) ); + var hasShownLauncher = ((tasksModel.launcherPosition(taskItem.launcherUrl) !== -1) + || (tasksModel.launcherPosition(taskItem.launcherUrlWithIcon) !== -1) ); //startup without launcher - var hideStartup = ((!hasShownLauncher || !tasksModel.launcherInCurrentActivity(mainItemContainer.launcherUrl)) - && mainItemContainer.isStartup); + var hideStartup = ((!hasShownLauncher || !tasksModel.launcherInCurrentActivity(taskItem.launcherUrl)) + && taskItem.isStartup); if (!Latte.WindowSystem.compositingActive) { visible = true; @@ -1472,11 +1472,11 @@ MouseArea{ return; } - if (mainItemContainer.containsMouse) { + if (taskItem.containsMouse) { if (root.showPreviews) { showPreviewWindow(); - } else if (mainItemContainer.isWindow && root.highlightWindows) { - root.windowsHovered( root.plasma515 ? model.WinIdList : model.LegacyWinIdList , mainItemContainer.containsMouse); + } else if (taskItem.isWindow && root.highlightWindows) { + root.windowsHovered( root.plasma515 ? model.WinIdList : model.LegacyWinIdList , taskItem.containsMouse); } } @@ -1494,12 +1494,12 @@ MouseArea{ id: resistanerTimerComponent Timer { id: resistanerTimer - interval: mainItemContainer.resistanceDelay + interval: taskItem.resistanceDelay repeat: false onTriggered: { - if (!mainItemContainer.inBlockingAnimation){ - mainItemContainer.isDragged = true; + if (!taskItem.inBlockingAnimation){ + taskItem.isDragged = true; } if (latteView && latteView.debugModeTimers) { @@ -1532,7 +1532,7 @@ MouseArea{ //I will blacklist google-chrome as I have not found any other case for this bug //to appear, but even this way there are cases that still appears... property int mainDelay: (AppId == "google-chrome") ? 0 : 2*root.durationTime*showWindowAnimation.speed - property int windowDelay: mainItemContainer.isStartup ? 3*root.durationTime*units.longDuration : mainDelay + property int windowDelay: taskItem.isStartup ? 3*root.durationTime*units.longDuration : mainDelay Component { id: delayShowWindow @@ -1544,9 +1544,9 @@ MouseArea{ repeat: false onTriggered: { - //console.log("I am in here: "+mainItemContainer.windowDelay); + //console.log("I am in here: "+taskItem.windowDelay); // showWindowAnimation.execute(); - if(!mainItemContainer.buffersAreReady) + if(!taskItem.buffersAreReady) showWindowAnimation.showWindow(); else showWindowAnimation.execute(); @@ -1571,8 +1571,8 @@ MouseArea{ repeat: false onTriggered: { - if (mainItemContainer.itemIndex >= 0){ - mainItemContainer.lastValidIndex = mainItemContainer.itemIndex; + if (taskItem.itemIndex >= 0){ + taskItem.lastValidIndex = taskItem.itemIndex; if (root.showWindowsOnlyFromLaunchers) { parabolicManager.updateTasksEdgesIndexes(); @@ -1592,7 +1592,7 @@ MouseArea{ id: wheelActionDelayer interval: 200 onTriggered: { - mainItemContainer.inWheelAction = false; + taskItem.inWheelAction = false; if (latteView && latteView.debugModeTimers) { console.log("plasmoid timer: wheelActionDelayer called..."); diff --git a/plasmoid/package/contents/ui/task/Wrapper.qml b/plasmoid/package/contents/ui/task/Wrapper.qml index 401205d78..c77085557 100644 --- a/plasmoid/package/contents/ui/task/Wrapper.qml +++ b/plasmoid/package/contents/ui/task/Wrapper.qml @@ -29,17 +29,17 @@ Item{ opacity: 0 width: { - if (!mainItemContainer.visible) + if (!taskItem.visible) return 0; - if (mainItemContainer.isSeparator){ + if (taskItem.isSeparator){ if (!root.vertical) return 0; //5 + root.widthMargins; else return (root.iconSize + root.widthMargins) + root.statesLineSize; } - if (mainItemContainer.isStartup && root.durationTime !==0 ) { + if (taskItem.isStartup && root.durationTime !==0 ) { var moreThickness = root.vertical ? addedSpace : 0; return cleanScalingWidth + moreThickness; @@ -49,17 +49,17 @@ Item{ } height: { - if (!mainItemContainer.visible) + if (!taskItem.visible) return 0; - if (mainItemContainer.isSeparator){ + if (taskItem.isSeparator){ if (root.vertical) return 0; //5 + root.heightMargins; else return (root.iconSize + root.heightMargins) + root.statesLineSize; } - if (mainItemContainer.isStartup && root.durationTime !==0){ + if (taskItem.isStartup && root.durationTime !==0){ var moreThickness = !root.vertical ? addedSpace : 0; return cleanScalingHeight + moreThickness; @@ -96,12 +96,12 @@ Item{ property real basicScalingWidth : (inTempScaling == true) ? ((root.iconSize + root.widthMargins) * scaleWidth) : cleanScalingWidth property real basicScalingHeight : (inTempScaling == true) ? ((root.iconSize + root.heightMargins) * scaleHeight) : cleanScalingHeight - property real regulatorWidth: mainItemContainer.isSeparator ? width : basicScalingWidth; - property real regulatorHeight: mainItemContainer.isSeparator ? height : basicScalingHeight; + property real regulatorWidth: taskItem.isSeparator ? width : basicScalingWidth; + property real regulatorHeight: taskItem.isSeparator ? height : basicScalingHeight; /// end of Scalers/////// //property int curIndex: icList.hoveredIndex - // property int index: mainItemContainer.Positioner.index + // property int index: taskItem.Positioner.index //property real center: (width + hiddenSpacerLeft.separatorSpace + hiddenSpacerRight.separatorSpace) / 2 property real center: (width + hiddenSpacerLeft.nHiddenSize + hiddenSpacerRight.nHiddenSize) / 2 @@ -120,7 +120,7 @@ Item{ Behavior on mScale { enabled: !root.globalDirectRender || inMimicParabolicAnimation NumberAnimation{ - duration: 3 * mainItemContainer.animationTime + duration: 3 * taskItem.animationTime easing.type: Easing.OutCubic } } @@ -164,7 +164,7 @@ Item{ id: firstPadding active: secondIndicator.active && !root.reverseLinesPosition - && (mainItemContainer.inAttentionAnimation || mainItemContainer.inFastRestoreAnimation) + && (taskItem.inAttentionAnimation || taskItem.inFastRestoreAnimation) && !root.disableAllWindowsFunctionality visible: active @@ -193,7 +193,7 @@ Item{ id: secondPadding active: firstIndicator.active && !root.reverseLinesPosition - && (mainItemContainer.inAttentionAnimation || mainItemContainer.inFastRestoreAnimation) + && (taskItem.inAttentionAnimation || taskItem.inFastRestoreAnimation) && !root.disableAllWindowsFunctionality visible: active @@ -258,7 +258,7 @@ Item{ hiddenSpacerRight.nScale = scales.rightScale - 1; } - if (!mainItemContainer.inAttentionAnimation) { + if (!taskItem.inAttentionAnimation) { mScale = root.zoomFactor; } else { var subSpacerScale = (root.zoomFactor-1)/2; @@ -267,20 +267,20 @@ Item{ hiddenSpacerRight.nScale = subSpacerScale; } - mainItemContainer.scalesUpdatedOnce = false; + taskItem.scalesUpdatedOnce = false; } } //nScale function signalUpdateScale(nIndex, nScale, step){ - if (!mainItemContainer.containsMouse && (index === nIndex) - && (mainItemContainer.hoverEnabled || inMimicParabolicAnimation)&&(waitingLaunchers.length===0)){ - if (mainItemContainer.inAttentionAnimation) { + if (!taskItem.containsMouse && (index === nIndex) + && (taskItem.hoverEnabled || inMimicParabolicAnimation)&&(waitingLaunchers.length===0)){ + if (taskItem.inAttentionAnimation) { var subSpacerScale = (nScale-1)/2; hiddenSpacerLeft.nScale = subSpacerScale; hiddenSpacerRight.nScale = subSpacerScale; - } else if (!inBlockingAnimation || mainItemContainer.inMimicParabolicAnimation) { + } else if (!inBlockingAnimation || taskItem.inMimicParabolicAnimation) { var newScale = 1; if(nScale >= 0) { @@ -299,8 +299,8 @@ Item{ } function sendEndOfNeedBothAxisAnimation(){ - if (mainItemContainer.isZoomed) { - mainItemContainer.isZoomed = false; + if (taskItem.isZoomed) { + taskItem.isZoomed = false; root.signalAnimationsNeedBothAxis(-1); } } @@ -324,10 +324,10 @@ Item{ } } - if ((mScale > 1) && !mainItemContainer.isZoomed) { - mainItemContainer.isZoomed = true; + if ((mScale > 1) && !taskItem.isZoomed) { + taskItem.isZoomed = true; root.signalAnimationsNeedBothAxis(1); - } else if ((mScale == 1) && mainItemContainer.isZoomed) { + } else if ((mScale == 1) && taskItem.isZoomed) { sendEndOfNeedBothAxisAnimation(); } } diff --git a/plasmoid/package/contents/ui/task/animations/ClickedAnimation.qml b/plasmoid/package/contents/ui/task/animations/ClickedAnimation.qml index 2643a87d1..b7a3dcce6 100644 --- a/plasmoid/package/contents/ui/task/animations/ClickedAnimation.qml +++ b/plasmoid/package/contents/ui/task/animations/ClickedAnimation.qml @@ -26,7 +26,7 @@ import org.kde.plasma.plasmoid 2.0 SequentialAnimation{ id: clickedAnimation - property bool pressed: mainItemContainer.pressed + property bool pressed: taskItem.pressed property int speed: root.durationTime*units.longDuration property real maxMScale: Math.max(1,root.zoomFactor - (root.zoomFactor - 1) / 2) @@ -67,15 +67,15 @@ SequentialAnimation{ onPressedChanged: { if( !running && pressed&& - ((mainItemContainer.lastButtonClicked == Qt.LeftButton)||(mainItemContainer.lastButtonClicked == Qt.MidButton)) ){ - //mainItemContainer.animationStarted(); + ((taskItem.lastButtonClicked == Qt.LeftButton)||(taskItem.lastButtonClicked == Qt.MidButton)) ){ + //taskItem.animationStarted(); start(); } } onStopped: { - if( !mainItemContainer.isDragged){ - //mainItemContainer.animationEnded(); + if( !taskItem.isDragged){ + //taskItem.animationEnded(); if(!root.latteView) checkListHovered.startDuration(6*units.longDuration); } diff --git a/plasmoid/package/contents/ui/task/animations/FastRestoreAnimation.qml b/plasmoid/package/contents/ui/task/animations/FastRestoreAnimation.qml index b157d449a..b793d4739 100644 --- a/plasmoid/package/contents/ui/task/animations/FastRestoreAnimation.qml +++ b/plasmoid/package/contents/ui/task/animations/FastRestoreAnimation.qml @@ -26,12 +26,12 @@ import org.kde.plasma.plasmoid 2.0 SequentialAnimation{ id: fastRestoreAnimation - property int speed: 5*mainItemContainer.animationTime + property int speed: 5*taskItem.animationTime ScriptAction { script: { - mainItemContainer.inFastRestoreAnimation = true; - mainItemContainer.inBlockingAnimation = true; + taskItem.inFastRestoreAnimation = true; + taskItem.inBlockingAnimation = true; } } @@ -62,21 +62,21 @@ SequentialAnimation{ } onStopped: { - if (!mainItemContainer.containsMouse && !parabolicManager.neighbourIsHovered(itemIndex)) { - mainItemContainer.inMimicParabolicAnimation = false; + if (!taskItem.containsMouse && !parabolicManager.neighbourIsHovered(itemIndex)) { + taskItem.inMimicParabolicAnimation = false; } else { - mainItemContainer.inMimicParabolicAnimation = true; + taskItem.inMimicParabolicAnimation = true; } newWindowAnimation.stop(); - if (!mainItemContainer.containsMouse && !parabolicManager.neighbourIsHovered(itemIndex)) { - mainItemContainer.inBlockingAnimation = false; + if (!taskItem.containsMouse && !parabolicManager.neighbourIsHovered(itemIndex)) { + taskItem.inBlockingAnimation = false; } root.mimicEnterForParabolic(); - mainItemContainer.inFastRestoreAnimation = false; + taskItem.inFastRestoreAnimation = false; // console.log("Fast Restore Animation ended..."); } diff --git a/plasmoid/package/contents/ui/task/animations/LauncherAnimation.qml b/plasmoid/package/contents/ui/task/animations/LauncherAnimation.qml index a86bcb1d8..28f9a4641 100644 --- a/plasmoid/package/contents/ui/task/animations/LauncherAnimation.qml +++ b/plasmoid/package/contents/ui/task/animations/LauncherAnimation.qml @@ -32,7 +32,7 @@ SequentialAnimation{ SequentialAnimation{ ScriptAction { - script: mainItemContainer.launcherAction(); + script: taskItem.launcherAction(); } //Ghost animation that acts as a delayer @@ -49,7 +49,7 @@ SequentialAnimation{ PropertyAnimation { target: wrapper property: (icList.orientation == Qt.Vertical) ? "tempScaleWidth" : "tempScaleHeight" - to: mainItemContainer.containsMouse ? root.zoomFactor : 1 + (0.65 * (root.zoomFactor-1)) + to: taskItem.containsMouse ? root.zoomFactor : 1 + (0.65 * (root.zoomFactor-1)) duration: launcherAnimation.speed easing.type: Easing.OutQuad } @@ -91,16 +91,16 @@ SequentialAnimation{ } onStopped: { - if (!mainItemContainer.inRemoveStage) { - mainItemContainer.inBouncingAnimation = false; - root.removeWaitingLauncher(mainItemContainer.launcherUrl); + if (!taskItem.inRemoveStage) { + taskItem.inBouncingAnimation = false; + root.removeWaitingLauncher(taskItem.launcherUrl); } root.setGlobalDirectRender(false); clearAnimationsSignals(); - mainItemContainer.setBlockingAnimation(false); - mainItemContainer.animationEnded(); + taskItem.setBlockingAnimation(false); + taskItem.animationEnded(); } function clearAnimationsSignals() { @@ -130,17 +130,17 @@ SequentialAnimation{ parabolicManager.clearTasksLowerThan(index); root.noTasksInAnimation++; - mainItemContainer.inBouncingAnimation = true; - mainItemContainer.setBlockingAnimation(true); + taskItem.inBouncingAnimation = true; + taskItem.setBlockingAnimation(true); //trying to fix the ListView nasty behavior //during the removal the anchoring for ListView children changes a lot - var previousTask = icList.childAtIndex(mainItemContainer.lastValidIndex-1); + var previousTask = icList.childAtIndex(taskItem.lastValidIndex-1); if (previousTask !== undefined && !previousTask.isStartup && !previousTask.inBouncingAnimation){ if (root.vertical) { - mainItemContainer.anchors.top = previousTask.bottom; + taskItem.anchors.top = previousTask.bottom; } else { - mainItemContainer.anchors.left = previousTask.right; + taskItem.anchors.left = previousTask.right; } } } @@ -152,13 +152,13 @@ SequentialAnimation{ function bounceLauncher(){ if(root.zoomFactor > 1){ - mainItemContainer.animationStarted(); + taskItem.animationStarted(); init(); start(); } else{ stopped(); - mainItemContainer.launcherAction(); + taskItem.launcherAction(); } } diff --git a/plasmoid/package/contents/ui/task/animations/NewWindowAnimation.qml b/plasmoid/package/contents/ui/task/animations/NewWindowAnimation.qml index e7efc43db..fa409c0de 100644 --- a/plasmoid/package/contents/ui/task/animations/NewWindowAnimation.qml +++ b/plasmoid/package/contents/ui/task/animations/NewWindowAnimation.qml @@ -30,7 +30,7 @@ SequentialAnimation{ property int speed: root.durationTime*units.longDuration property bool isDemandingAttention: (IsDemandingAttention === true) - property bool containsMouse: mainItemContainer.containsMouse + property bool containsMouse: taskItem.containsMouse property bool needsThicknessSent: false //flag to check if the signal for thickness was sent SequentialAnimation{ @@ -44,7 +44,7 @@ SequentialAnimation{ duration: newWindowAnimation.speed easing.type: Easing.OutQuad - property real thickPercentage: mainItemContainer.inAttentionAnimation ? 1 : 0.6 + property real thickPercentage: taskItem.inAttentionAnimation ? 1 : 0.6 } PropertyAnimation { @@ -73,8 +73,8 @@ SequentialAnimation{ wrapper.tempScaleWidth = 1; wrapper.tempScaleHeight = 1; - mainItemContainer.setBlockingAnimation(false); - mainItemContainer.inAttentionAnimation = false; + taskItem.setBlockingAnimation(false); + taskItem.inAttentionAnimation = false; } onStopped: { @@ -96,7 +96,7 @@ SequentialAnimation{ } function init(){ - mainItemContainer.setBlockingAnimation(true); + taskItem.setBlockingAnimation(true); wrapper.tempScaleWidth = wrapper.mScale; wrapper.tempScaleHeight = wrapper.mScale; @@ -105,7 +105,7 @@ SequentialAnimation{ loops = 1; else { loops = 20; - mainItemContainer.inAttentionAnimation = true; + taskItem.inAttentionAnimation = true; } if (!needsThicknessSent) { @@ -125,11 +125,11 @@ SequentialAnimation{ } Component.onCompleted: { - mainItemContainer.groupWindowAdded.connect(bounceNewWindow); + taskItem.groupWindowAdded.connect(bounceNewWindow); } Component.onDestruction: { - mainItemContainer.groupWindowAdded.disconnect(bounceNewWindow); + taskItem.groupWindowAdded.disconnect(bounceNewWindow); sendEndOfNeedThicknessAnimation(); } } diff --git a/plasmoid/package/contents/ui/task/animations/RealRemovalAnimation.qml b/plasmoid/package/contents/ui/task/animations/RealRemovalAnimation.qml index 550328563..a3d6e4b3c 100644 --- a/plasmoid/package/contents/ui/task/animations/RealRemovalAnimation.qml +++ b/plasmoid/package/contents/ui/task/animations/RealRemovalAnimation.qml @@ -26,49 +26,49 @@ import org.kde.latte 0.2 as Latte SequentialAnimation { id: taskRealRemovalAnimation - 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: taskItem; property: "ListView.delayRemove"; value: true } + PropertyAction { target: taskItem; property: "inAnimation"; value: true } + PropertyAction { target: taskItem; property: "inAddRemoveAnimation"; value: true } + PropertyAction { target: taskItem; property: "inRemoveStage"; value: true } //Animation Add/Remove (1) - when is window with no launcher, animations enabled //Animation Add/Remove (4) - the user removes a launcher, animation enabled - property bool animation1: ((((tasksModel.launcherPosition(mainItemContainer.launcherUrl) === -1) - && (tasksModel.launcherPosition(mainItemContainer.launcherUrlWithIcon) === -1) ) - || !tasksModel.launcherInCurrentActivity(mainItemContainer.launcherUrl)) - && !mainItemContainer.isStartup && Latte.WindowSystem.compositingActive) + property bool animation1: ((((tasksModel.launcherPosition(taskItem.launcherUrl) === -1) + && (tasksModel.launcherPosition(taskItem.launcherUrlWithIcon) === -1) ) + || !tasksModel.launcherInCurrentActivity(taskItem.launcherUrl)) + && !taskItem.isStartup && Latte.WindowSystem.compositingActive) - property bool animation4: ((mainItemContainer.launcherUrl===root.launcherForRemoval - || mainItemContainer.launcherUrlWithIcon===root.launcherForRemoval ) - && !mainItemContainer.isStartup && Latte.WindowSystem.compositingActive) + property bool animation4: ((taskItem.launcherUrl===root.launcherForRemoval + || taskItem.launcherUrlWithIcon===root.launcherForRemoval ) + && !taskItem.isStartup && Latte.WindowSystem.compositingActive) property bool enabledAnimation: (animation1 || animation4) && (root.durationTime !== 0) - && !mainItemContainer.inBouncingAnimation - && !mainItemContainer.isSeparator - && mainItemContainer.visible; + && !taskItem.inBouncingAnimation + && !taskItem.isSeparator + && taskItem.visible; ScriptAction{ script:{ //! When a window is removed and afterwards its launcher must be shown immediately! - if (!enabledAnimation && mainItemContainer.isWindow && !mainItemContainer.isSeparator - && tasksModel.launcherPosition(mainItemContainer.launcherUrl) !== -1 - && !root.immediateLauncherExists(mainItemContainer.launcherUrl)){ - root.addImmediateLauncher(mainItemContainer.launcherUrl); + if (!enabledAnimation && taskItem.isWindow && !taskItem.isSeparator + && tasksModel.launcherPosition(taskItem.launcherUrl) !== -1 + && !root.immediateLauncherExists(taskItem.launcherUrl)){ + root.addImmediateLauncher(taskItem.launcherUrl); } //trying to fix the ListView nasty behavior //during the removal the anchoring for ListView children changes a lot - var previousTask = icList.childAtIndex(mainItemContainer.lastValidIndex-1); + var previousTask = icList.childAtIndex(taskItem.lastValidIndex-1); if (previousTask !== undefined && !previousTask.isStartup && !previousTask.inBouncingAnimation){ //! When removing a task and there are surrounding separators then the hidden spacers //! are updated immediately for the neighbour tasks. In such case in order to not break //! the removal animation a small margin must applied var nextTaskIsSeparator = (lastValidIndex !== -1) && enabledAnimation && - ((mainItemContainer.hasNeighbourSeparator(lastValidIndex+1,true) && !mainItemContainer.isSeparator && lastValidIndexparabolicManager.lastRealTaskIndex)); var previousTaskIsSeparator = (lastValidIndex !== -1) && enabledAnimation && - ((mainItemContainer.hasNeighbourSeparator(lastValidIndex-1,false) && !mainItemContainer.isSeparator && lastValidIndex>parabolicManager.firstRealTaskIndex) + ((taskItem.hasNeighbourSeparator(lastValidIndex-1,false) && !taskItem.isSeparator && lastValidIndex>parabolicManager.firstRealTaskIndex) || (latteView && latteView.parabolicManager.isSeparator(latteView.latteAppletPos-1) && lastValidIndex<=parabolicManager.firstRealTaskIndex)); var spacer = nextTaskIsSeparator ? -(2+root.iconMargin/2) : ( previousTaskIsSeparator ? (2+root.iconMargin/2)/2 : 0); @@ -77,22 +77,22 @@ SequentialAnimation { //console.log("Removing ::: " + lastValidIndex + " _ " + launcherUrl + " _ " + previousTaskIsSeparator + " _ " + nextTaskIsSeparator); if (root.vertical) { - mainItemContainer.anchors.top = previousTask.bottom; - mainItemContainer.anchors.topMargin = spacer; + taskItem.anchors.top = previousTask.bottom; + taskItem.anchors.topMargin = spacer; } else { - mainItemContainer.anchors.left = previousTask.right; - mainItemContainer.anchors.leftMargin = spacer; + taskItem.anchors.left = previousTask.right; + taskItem.anchors.leftMargin = spacer; } } - // console.log("1." + mainItemContainer.launcherUrl + " - " + taskRealRemovalAnimation.enabledAnimation); - // console.log("2." + root.launcherForRemoval + " - " + mainItemContainer.isLauncher); + // console.log("1." + taskItem.launcherUrl + " - " + taskRealRemovalAnimation.enabledAnimation); + // console.log("2." + root.launcherForRemoval + " - " + taskItem.isLauncher); root.signalAnimationsNeedLength(1); if (wrapper.mScale > 1 && !taskRealRemovalAnimation.enabledAnimation - && !mainItemContainer.inBouncingAnimation && Latte.WindowSystem.compositingActive) { - parabolicManager.setFrozenTask(mainItemContainer.launcherUrl, wrapper.mScale); + && !taskItem.inBouncingAnimation && Latte.WindowSystem.compositingActive) { + parabolicManager.setFrozenTask(taskItem.launcherUrl, wrapper.mScale); } } } @@ -106,7 +106,7 @@ SequentialAnimation { //this duration must be a bit less than the bouncing animation. Otherwise the //smooth transition between removals is breaking - duration: mainItemContainer.inBouncingAnimation && !mainItemContainer.isSeparator? 4*launcherSpeedStep + 50 : 0 + duration: taskItem.inBouncingAnimation && !taskItem.isSeparator? 4*launcherSpeedStep + 50 : 0 easing.type: Easing.InQuad property int launcherSpeedStep: root.durationTime * 0.8 * units.longDuration @@ -126,7 +126,7 @@ SequentialAnimation { ParallelAnimation{ id: removalAnimation - // property int speed: (IsStartup && !mainItemContainer.visible)? 0 : 400 + // property int speed: (IsStartup && !taskItem.visible)? 0 : 400 //property int speed: 400 NumberAnimation { target: wrapper; @@ -164,37 +164,37 @@ SequentialAnimation { root.signalAnimationsNeedLength(-1); - if(mainItemContainer.launcherUrl===root.launcherForRemoval && mainItemContainer.isLauncher) + if(taskItem.launcherUrl===root.launcherForRemoval && taskItem.isLauncher) root.launcherForRemoval=""; - if (windowsPreviewDlg.visible && windowsPreviewDlg.mainItem.parentTask === mainItemContainer + if (windowsPreviewDlg.visible && windowsPreviewDlg.mainItem.parentTask === taskItem && isWindow && !isGroupParent){ hidePreview(); } if (root.showWindowsOnlyFromLaunchers) { if (root.vertical) { - mainItemContainer.anchors.top = undefined; - mainItemContainer.anchors.topMargin = 0; + taskItem.anchors.top = undefined; + taskItem.anchors.topMargin = 0; } else { - mainItemContainer.anchors.left = undefined; - mainItemContainer.anchors.leftMargin = 0; + taskItem.anchors.left = undefined; + taskItem.anchors.leftMargin = 0; } } - mainItemContainer.visible = false; + taskItem.visible = false; //send signal that the launcher is really removing - if (mainItemContainer.inBouncingAnimation) { - root.removeWaitingLauncher(mainItemContainer.launcherUrl); + if (taskItem.inBouncingAnimation) { + root.removeWaitingLauncher(taskItem.launcherUrl); 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: taskItem; property: "inAnimation"; value: false } + PropertyAction { target: taskItem; property: "inAddRemoveAnimation"; value: false } + PropertyAction { target: taskItem; property: "inRemoveStage"; value: false } - PropertyAction { target: mainItemContainer; property: "ListView.delayRemove"; value: false } + PropertyAction { target: taskItem; property: "ListView.delayRemove"; value: false } } diff --git a/plasmoid/package/contents/ui/task/animations/RemoveWindowFromGroupAnimation.qml b/plasmoid/package/contents/ui/task/animations/RemoveWindowFromGroupAnimation.qml index bb59c3cf7..16754efbd 100644 --- a/plasmoid/package/contents/ui/task/animations/RemoveWindowFromGroupAnimation.qml +++ b/plasmoid/package/contents/ui/task/animations/RemoveWindowFromGroupAnimation.qml @@ -47,11 +47,11 @@ Item{ } Component.onCompleted: { - mainItemContainer.groupWindowRemoved.connect(removeTask); + taskItem.groupWindowRemoved.connect(removeTask); } Component.onDestruction: { - mainItemContainer.groupWindowRemoved.disconnect(removeTask); + taskItem.groupWindowRemoved.disconnect(removeTask); } ///////////// Component for animating removing window from group diff --git a/plasmoid/package/contents/ui/task/animations/RestoreAnimation.qml b/plasmoid/package/contents/ui/task/animations/RestoreAnimation.qml index c691acce0..4096e502d 100644 --- a/plasmoid/package/contents/ui/task/animations/RestoreAnimation.qml +++ b/plasmoid/package/contents/ui/task/animations/RestoreAnimation.qml @@ -31,7 +31,7 @@ SequentialAnimation{ target: wrapper property: "mScale" to: 1 - duration: 4 * mainItemContainer.animationTime + duration: 4 * taskItem.animationTime easing.type: Easing.InCubic } @@ -39,7 +39,7 @@ SequentialAnimation{ target: hiddenSpacerLeft property: "nScale" to: 0 - duration: 4 * mainItemContainer.animationTime + duration: 4 * taskItem.animationTime easing.type: Easing.InCubic } @@ -47,7 +47,7 @@ SequentialAnimation{ target: hiddenSpacerRight property: "nScale" to: 0 - duration: 4 * mainItemContainer.animationTime + duration: 4 * taskItem.animationTime easing.type: Easing.InCubic } } diff --git a/plasmoid/package/contents/ui/task/animations/ShowWindowAnimation.qml b/plasmoid/package/contents/ui/task/animations/ShowWindowAnimation.qml index cd57bda94..a3f307084 100644 --- a/plasmoid/package/contents/ui/task/animations/ShowWindowAnimation.qml +++ b/plasmoid/package/contents/ui/task/animations/ShowWindowAnimation.qml @@ -80,15 +80,15 @@ SequentialAnimation{ } onStopped: { - mainItemContainer.inAddRemoveAnimation = false; + taskItem.inAddRemoveAnimation = false; - if(mainItemContainer.isWindow || mainItemContainer.isStartup){ + if(taskItem.isWindow || taskItem.isStartup){ taskInitComponent.createObject(wrapper); - if (mainItemContainer.isDemandingAttention){ - mainItemContainer.groupWindowAdded(); + if (taskItem.isDemandingAttention){ + taskItem.groupWindowAdded(); } } - mainItemContainer.inAnimation = false; + taskItem.inAnimation = false; if (showWindowAnimation.animationSent) { root.signalAnimationsNeedLength(-1); @@ -104,85 +104,85 @@ SequentialAnimation{ var nextTask = icList.childAtIndex(index+1); if (previousTask !== undefined && nextTask !== undefined && nextTask.inBouncingAnimation){ if (root.vertical) { - mainItemContainer.anchors.top = previousTask.bottom; + taskItem.anchors.top = previousTask.bottom; } else { - mainItemContainer.anchors.left = previousTask.right; + taskItem.anchors.left = previousTask.right; } } } - var hasShownLauncher = ((tasksModel.launcherPosition(mainItemContainer.launcherUrl) !== -1) - || (tasksModel.launcherPosition(mainItemContainer.launcherUrlWithIcon) !== -1) ); + var hasShownLauncher = ((tasksModel.launcherPosition(taskItem.launcherUrl) !== -1) + || (tasksModel.launcherPosition(taskItem.launcherUrlWithIcon) !== -1) ); var launcherIsAlreadyShown = hasShownLauncher && isLauncher && !root.inActivityChange; //Animation Add/Remove (2) - when is window with no launcher, animations enabled //Animation Add/Remove (3) - when is launcher with no window, animations enabled - var animation2 = ((!hasShownLauncher || !tasksModel.launcherInCurrentActivity(mainItemContainer.launcherUrl)) - && mainItemContainer.isWindow + var animation2 = ((!hasShownLauncher || !tasksModel.launcherInCurrentActivity(taskItem.launcherUrl)) + && taskItem.isWindow && Latte.WindowSystem.compositingActive); - var animation3 = (!root.immediateLauncherExists(mainItemContainer.launcherUrl) - && mainItemContainer.isLauncher + var animation3 = (!root.immediateLauncherExists(taskItem.launcherUrl) + && taskItem.isLauncher && Latte.WindowSystem.compositingActive); - var activities = tasksModel.launcherActivities(mainItemContainer.launcherUrl); - var animation6 = (root.inActivityChange && mainItemContainer.isWindow + var activities = tasksModel.launcherActivities(taskItem.launcherUrl); + var animation6 = (root.inActivityChange && taskItem.isWindow && activities.indexOf(activityInfo.currentActivity)>=0 && activities.indexOf(activityInfo.previousActivity) === -1 && Latte.WindowSystem.compositingActive); //startup without launcher, animation should be blocked - var launcherExists = !(!hasShownLauncher || !tasksModel.launcherInCurrentActivity(mainItemContainer.launcherUrl)); + var launcherExists = !(!hasShownLauncher || !tasksModel.launcherInCurrentActivity(taskItem.launcherUrl)); - //var hideStartup = launcherExists && mainItemContainer.isStartup; //! fix #976 - var hideWindow = root.showWindowsOnlyFromLaunchers && !launcherExists && mainItemContainer.isWindow; + //var hideStartup = launcherExists && taskItem.isStartup; //! fix #976 + var hideWindow = root.showWindowsOnlyFromLaunchers && !launcherExists && taskItem.isWindow; - if (root.immediateLauncherExists(mainItemContainer.launcherUrl) && mainItemContainer.isLauncher) { - root.removeImmediateLauncher(mainItemContainer.launcherUrl); + if (root.immediateLauncherExists(taskItem.launcherUrl) && taskItem.isLauncher) { + root.removeImmediateLauncher(taskItem.launcherUrl); } //if (hideStartup || hideWindow) { //fix #976 if (hideWindow) { isForcedHidden = true; - mainItemContainer.visible = false; + taskItem.visible = false; wrapper.tempScaleWidth = 0; wrapper.tempScaleHeight = 0; wrapper.opacity = 0; - mainItemContainer.inAnimation = false; + taskItem.inAnimation = false; } else if (!Latte.WindowSystem.compositingActive || root.inDraggingPhase - || mainItemContainer.isSeparator) { + || taskItem.isSeparator) { isForcedHidden = false; - mainItemContainer.visible = true; + taskItem.visible = true; wrapper.tempScaleWidth = 1; wrapper.tempScaleHeight = 1; wrapper.mScale = 1; wrapper.opacity = 1; - mainItemContainer.inAnimation = false; + taskItem.inAnimation = false; } else if (( animation2 || animation3 || animation6 || isForcedHidden) && (root.durationTime !== 0) && !launcherIsAlreadyShown){ isForcedHidden = false; - mainItemContainer.visible = true; + taskItem.visible = true; wrapper.tempScaleWidth = 0; wrapper.tempScaleHeight = 0; start(); } else { isForcedHidden = false; - var frozenTask = parabolicManager.getFrozenTask(mainItemContainer.launcherUrl); + var frozenTask = parabolicManager.getFrozenTask(taskItem.launcherUrl); if (frozenTask && frozenTask.mScale>1) { wrapper.mScale = frozenTask.mScale; - parabolicManager.removeFrozenTask(mainItemContainer.launcherUrl); + parabolicManager.removeFrozenTask(taskItem.launcherUrl); } else { wrapper.tempScaleWidth = 1; wrapper.tempScaleHeight = 1; } //! by enabling it we break the bouncing animation - //mainItemContainer.visible = true; + //taskItem.visible = true; wrapper.opacity = 1; - mainItemContainer.inAnimation = false; + taskItem.inAnimation = false; } }