1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-01-12 01:17:55 +03:00

plasmoid:single point for TaskItem.Abilities

--expose abilities to items from a single point and use
that in order to provide functionality for each different
item.
This commit is contained in:
Michail Vourlakos 2021-01-16 13:35:54 +02:00
parent b2aa7038a9
commit 33c575b09f
19 changed files with 205 additions and 219 deletions

View File

@ -1081,14 +1081,7 @@ Item {
boundsBehavior: Flickable.StopAtBounds
orientation: plasmoid.formFactor === PlasmaCore.Types.Vertical ? Qt.Vertical : Qt.Horizontal
delegate: Task.TaskItem{
animations: appletAbilities.animations
debug: appletAbilities.debug
indexer: appletAbilities.indexer
launchers: appletAbilities.launchers
metrics: appletAbilities.metrics
parabolic: appletAbilities.parabolic
requires: appletAbilities.requires
shortcuts: appletAbilities.shortcuts
abilities: appletAbilities
}
property int currentSpot : -1000

View File

@ -28,7 +28,7 @@ Item{
width: root.vertical ? wrapper.width : nHiddenSize
height: root.vertical ? nHiddenSize : wrapper.height
visible: (rightSpacer ? index === taskItem.indexer.lastVisibleItemIndex : index === taskItem.indexer.firstVisibleItemIndex)
visible: (rightSpacer ? index === taskItem.abilities.indexer.lastVisibleItemIndex : index === taskItem.abilities.indexer.firstVisibleItemIndex)
|| (separatorSpace > 0) || taskItem.inAttentionAnimation
|| taskItem.inFastRestoreAnimation || taskItem.inMimicParabolicAnimation
@ -45,8 +45,8 @@ Item{
//and it is used later on Behaviors in order to not break
//the activity change animations from removal/additions of tasks
//! && !root.inActivityChange (deprecated) in order to check if it is fixed
property int separatorSpace: neighbourSeparator && !isSeparator && taskItem.parabolic.isEnabled
&& !(taskItem.indexer.separators.length>0 && root.dragSource) ?
property int separatorSpace: neighbourSeparator && !isSeparator && taskItem.abilities.parabolic.isEnabled
&& !(taskItem.abilities.indexer.separators.length>0 && root.dragSource) ?
(LatteCore.Environment.separatorLength/2) : 0
property bool rightSpacer: false
@ -63,7 +63,7 @@ Item{
} else if (!inAttentionAnimation && !inMimicParabolicAnimation && !inFastRestoreAnimation) {
return (nScale > 0) ? (taskItem.spacersMaxSize * nScale) + separatorSpace : separatorSpace;
} else {
return (nScale > 0) ? (taskItem.metrics.iconSize * nScale) + separatorSpace : separatorSpace;
return (nScale > 0) ? (taskItem.abilities.metrics.iconSize * nScale) + separatorSpace : separatorSpace;
}
}
}
@ -81,7 +81,7 @@ Item{
id: animatedBehavior
enabled: (taskItem.inFastRestoreAnimation || showWindowAnimation.running || restoreAnimation.running
|| root.inActivityChange || taskItem.inRemoveStage)
|| (taskItem.containsMouse && inAttentionAnimation && wrapper.mScale!==taskItem.parabolic.factor.zoom)
|| (taskItem.containsMouse && inAttentionAnimation && wrapper.mScale!==taskItem.abilities.parabolic.factor.zoom)
NumberAnimation{ duration: 3 * taskItem.animationTime }
}
@ -92,7 +92,7 @@ Item{
}
Loader{
active: taskItem.debug.spacersEnabled
active: taskItem.abilities.debug.spacersEnabled
sourceComponent: Rectangle{
width: !root.vertical ? hiddenSpacer.width : 1

View File

@ -118,12 +118,12 @@ Item{
TitleTooltipParent{
id: titleTooltipParent
thickness: taskItem.parabolic.factor.zoom * taskItem.metrics.totals.thickness
thickness: taskItem.abilities.parabolic.factor.zoom * taskItem.abilities.metrics.totals.thickness
}
TitleTooltipParent{
id: previewsTooltipParent
thickness: (taskItem.parabolic.factor.zoom * taskItem.metrics.totals.thickness)
thickness: (taskItem.abilities.parabolic.factor.zoom * taskItem.abilities.metrics.totals.thickness)
}
//!
@ -159,7 +159,7 @@ Item{
height: width
source: decoration
smooth: taskItem.parabolic.factor.zoom === 1 ? true : false
smooth: taskItem.abilities.parabolic.factor.zoom === 1 ? true : false
providesColors: indicators ? indicators.info.needsIconColors : false
opacity: root.enableShadows
@ -184,12 +184,12 @@ Item{
}
}
property int zoomedSize: taskItem.parabolic.factor.zoom * taskItem.metrics.iconSize
property int zoomedSize: taskItem.abilities.parabolic.factor.zoom * taskItem.abilities.metrics.iconSize
property real basicScalingWidth : wrapper.inTempScaling ? (taskItem.metrics.iconSize * wrapper.scaleWidth) :
taskItem.metrics.iconSize * wrapper.mScale
property real basicScalingHeight : wrapper.inTempScaling ? (taskItem.metrics.iconSize * wrapper.scaleHeight) :
taskItem.metrics.iconSize * wrapper.mScale
property real basicScalingWidth : wrapper.inTempScaling ? (taskItem.abilities.metrics.iconSize * wrapper.scaleWidth) :
taskItem.abilities.metrics.iconSize * wrapper.mScale
property real basicScalingHeight : wrapper.inTempScaling ? (taskItem.abilities.metrics.iconSize * wrapper.scaleHeight) :
taskItem.abilities.metrics.iconSize * wrapper.mScale
property real newTempSize: {
if (wrapper.opacity === 1 ) {
@ -253,7 +253,7 @@ Item{
to: "*"
enabled: !fastRestoreAnimation.running && !taskItem.inMimicParabolicAnimation
AnchorAnimation { duration: 1.5 * taskItem.animations.speedFactor.current * taskItem.animations.duration.large }
AnchorAnimation { duration: 1.5 * taskItem.abilities.animations.speedFactor.current * taskItem.abilities.animations.duration.large }
}
]
} //IconImageBuffer
@ -295,7 +295,7 @@ Item{
property bool showAudio: (root.showAudioBadge && taskItem.hasAudioStream && taskItem.playingAudio && !taskItem.isSeparator) && !shortcutBadge.active
Behavior on activateProgress {
NumberAnimation { duration: 2 * taskItem.animations.speedFactor.current * taskItem.animations.duration.large }
NumberAnimation { duration: 2 * taskItem.abilities.animations.speedFactor.current * taskItem.abilities.animations.duration.large }
}
sourceComponent: Item{
@ -563,7 +563,7 @@ Item{
contrast: 0.1
Behavior on opacity {
NumberAnimation { duration: taskItem.animations.speedFactor.current * taskItem.animations.duration.large }
NumberAnimation { duration: taskItem.abilities.animations.speedFactor.current * taskItem.abilities.animations.duration.large }
}
}
@ -598,8 +598,8 @@ Item{
height: !root.vertical ? thickness : length
anchors.centerIn: parent
readonly property int length: taskItem.metrics.totals.length
readonly property int thickness: taskItem.metrics.totals.thickness
readonly property int length: taskItem.abilities.metrics.totals.length
readonly property int thickness: taskItem.abilities.metrics.totals.thickness
readonly property real applyOpacity: root.dropNewLauncher && !mouseHandler.onlyLaunchers
&& (root.dragSource == null) && (mouseHandler.hoveredItem === taskItem) ? 0.7 : 0
@ -662,14 +662,14 @@ Item{
Transition{
id: isDraggedTransition
to: "isDragged"
property int speed: taskItem.animations.speedFactor.current * taskItem.animations.duration.large
property int speed: taskItem.abilities.animations.speedFactor.current * taskItem.abilities.animations.duration.large
SequentialAnimation{
ScriptAction{
script: {
taskItem.animations.needThickness.addEvent(draggingNeedThicknessEvent);
taskItem.abilities.animations.needThickness.addEvent(draggingNeedThicknessEvent);
taskItem.inBlockingAnimation = true;
taskItem.parabolic.setDirectRenderingEnabled(false);
taskItem.abilities.parabolic.setDirectRenderingEnabled(false);
}
}
@ -677,7 +677,7 @@ Item{
target: wrapper
property: "mScale"
to: 1
duration: taskItem.parabolic.factor.zoom === 1 ? 0 : (isDraggedTransition.speed*1.2)
duration: taskItem.abilities.parabolic.factor.zoom === 1 ? 0 : (isDraggedTransition.speed*1.2)
easing.type: Easing.OutQuad
}
@ -709,16 +709,16 @@ Item{
ScriptAction{
script: {
taskItem.animations.needThickness.removeEvent(draggingNeedThicknessEvent);
taskItem.abilities.animations.needThickness.removeEvent(draggingNeedThicknessEvent);
}
}
}
onRunningChanged: {
if(running){
taskItem.animationStarted();
taskItem.abilities.animationstarted();
} else {
taskItem.animations.needThickness.removeEvent(draggingNeedThicknessEvent);
taskItem.abilities.animations.needThickness.removeEvent(draggingNeedThicknessEvent);
}
}
},
@ -726,12 +726,12 @@ Item{
id: defaultTransition
from: "isDragged"
to: "*"
property int speed: taskItem.animations.speedFactor.current * taskItem.animations.duration.large
property int speed: taskItem.abilities.animations.speedFactor.current * taskItem.abilities.animations.duration.large
SequentialAnimation{
ScriptAction{
script: {
taskItem.parabolic.setDirectRenderingEnabled(false);
taskItem.abilities.parabolic.setDirectRenderingEnabled(false);
}
}
@ -779,8 +779,8 @@ Item{
onRunningChanged: {
if(!running){
if (parabolicAreaLoader.active) {
var halfZoom = 1 + ((taskItem.parabolic.factor.zoom - 1) / 2);
parabolicAreaLoader.item.calculateParabolicScales(taskItem.metrics.totals.thickness/2);
var halfZoom = 1 + ((taskItem.abilities.parabolic.factor.zoom - 1) / 2);
parabolicAreaLoader.item.calculateParabolicScales(taskItem.abilities.metrics.totals.thickness/2);
}
taskItem.animationEnded();

View File

@ -29,7 +29,7 @@ Item {
property int lastMouseX: 0
property int lastMouseY: 0
readonly property bool containsMouse: (taskItem.parabolic.currentParabolicItem === _parabolicArea) || parabolicMouseArea.containsMouse
readonly property bool containsMouse: (taskItem.abilities.parabolic.currentParabolicItem === _parabolicArea) || parabolicMouseArea.containsMouse
readonly property real center: wrapper.center
@ -38,13 +38,13 @@ Item {
anchors.fill: parent
enabled: visible
hoverEnabled: true
visible: taskItem.parabolic.currentParabolicItem !== _parabolicArea
visible: taskItem.abilities.parabolic.currentParabolicItem !== _parabolicArea
onEntered: {
taskItem.parabolic.setCurrentParabolicItem(_parabolicArea);
taskItem.abilities.parabolic.setCurrentParabolicItem(_parabolicArea);
var vIndex = taskItem.shortcuts.shortcutIndex(taskItem.itemIndex);
taskItem.parabolic.setCurrentParabolicItemIndex(vIndex);
var vIndex = taskItem.abilities.shortcuts.shortcutIndex(taskItem.itemIndex);
taskItem.abilities.parabolic.setCurrentParabolicItemIndex(vIndex);
// mouseX/Y can not be trusted at this point
//_parabolicArea.parabolicEntered(mouseX, mouseY);
@ -91,11 +91,11 @@ Item {
}
if((inAnimation == false)&&(!root.taskInAnimation)&&(!root.disableRestoreZoom) && taskItem.hoverEnabled){
if( ((wrapper.mScale === 1 || wrapper.mScale === taskItem.parabolic.factor.zoom) && !taskItem.parabolic.directRenderingEnabled)
|| taskItem.parabolic.directRenderingEnabled || !taskItem.scalesUpdatedOnce) {
if( ((wrapper.mScale === 1 || wrapper.mScale === taskItem.abilities.parabolic.factor.zoom) && !taskItem.abilities.parabolic.directRenderingEnabled)
|| taskItem.abilities.parabolic.directRenderingEnabled || !taskItem.scalesUpdatedOnce) {
if(root.dragSource == null){
var step = Math.abs(icList.currentSpot-mousePos);
if (step >= taskItem.animations.hoverPixelSensitivity){
if (step >= taskItem.abilities.animations.hoverPixelSensitivity){
icList.currentSpot = mousePos;
calculateParabolicScales(mousePos);
@ -110,30 +110,30 @@ Item {
}
function calculateParabolicScales( currentMousePosition ){
if (taskItem.parabolic.factor.zoom===1 || parabolic.restoreZoomIsBlocked) {
if (taskItem.abilities.parabolic.factor.zoom===1 || taskItem.abilities.parabolic.restoreZoomIsBlocked) {
return;
}
if (root.dragSource === null) {
//use the new parabolic ability in order to handle all parabolic effect messages
var scales = taskItem.parabolic.applyParabolicEffect(index, currentMousePosition, center);
var scales = taskItem.abilities.parabolic.applyParabolicEffect(index, currentMousePosition, center);
//Left hiddenSpacer for first task
if(((index === taskItem.indexer.firstVisibleItemIndex)&&(root.tasksCount>0)) && !root.disableLeftSpacer
if(((index === taskItem.abilities.indexer.firstVisibleItemIndex)&&(root.tasksCount>0)) && !root.disableLeftSpacer
&& !inMimicParabolicAnimation && !inFastRestoreAnimation && !inAttentionAnimation){
hiddenSpacerLeft.nScale = scales.leftScale - 1;
}
//Right hiddenSpacer for last task
if(((index === taskItem.indexer.lastVisibleItemIndex )&&(root.tasksCount>0)) && !root.disableRightSpacer
if(((index === taskItem.abilities.indexer.lastVisibleItemIndex )&&(root.tasksCount>0)) && !root.disableRightSpacer
&& !inMimicParabolicAnimation && !inFastRestoreAnimation && !inAttentionAnimation){
hiddenSpacerRight.nScale = scales.rightScale - 1;
}
if (!taskItem.inAttentionAnimation) {
wrapper.mScale = taskItem.parabolic.factor.zoom;
wrapper.mScale = taskItem.abilities.parabolic.factor.zoom;
} else {
var subSpacerScale = (taskItem.parabolic.factor.zoom-1)/2;
var subSpacerScale = (taskItem.abilities.parabolic.factor.zoom-1)/2;
hiddenSpacerLeft.nScale = subSpacerScale;
hiddenSpacerRight.nScale = subSpacerScale;
@ -176,10 +176,10 @@ Item {
updateScale(delegateIndex, newScale, step);
if (newScale > 1) { // clear lower items
taskItem.parabolic.sglUpdateLowerItemScale(delegateIndex-1, 1, 0);
taskItem.abilities.parabolic.sglUpdateLowerItemScale(delegateIndex-1, 1, 0);
}
} else {
taskItem.parabolic.sglUpdateLowerItemScale(delegateIndex-1, newScale, step);
taskItem.abilities.parabolic.sglUpdateLowerItemScale(delegateIndex-1, newScale, step);
}
} else if ((newScale === 1) && (index < delegateIndex)) {
updateScale(index, 1, 0);
@ -193,10 +193,10 @@ Item {
updateScale(delegateIndex, newScale, step);
if (newScale > 1) { // clear lower items
taskItem.parabolic.sglUpdateHigherItemScale(delegateIndex+1, 1, 0); // clear higher items
taskItem.abilities.parabolic.sglUpdateHigherItemScale(delegateIndex+1, 1, 0); // clear higher items
}
} else {
taskItem.parabolic.sglUpdateHigherItemScale(delegateIndex+1, newScale, step);
taskItem.abilities.parabolic.sglUpdateHigherItemScale(delegateIndex+1, newScale, step);
}
} else if ((newScale === 1) && (index > delegateIndex)) {
updateScale(index, 1, 0);
@ -204,12 +204,12 @@ Item {
}
Component.onCompleted: {
taskItem.parabolic.sglUpdateLowerItemScale.connect(sltUpdateLowerItemScale);
taskItem.parabolic.sglUpdateHigherItemScale.connect(sltUpdateHigherItemScale);
taskItem.abilities.parabolic.sglUpdateLowerItemScale.connect(sltUpdateLowerItemScale);
taskItem.abilities.parabolic.sglUpdateHigherItemScale.connect(sltUpdateHigherItemScale);
}
Component.onDestruction: {
taskItem.parabolic.sglUpdateLowerItemScale.disconnect(sltUpdateLowerItemScale);
taskItem.parabolic.sglUpdateHigherItemScale.disconnect(sltUpdateHigherItemScale);
taskItem.abilities.parabolic.sglUpdateLowerItemScale.disconnect(sltUpdateLowerItemScale);
taskItem.abilities.parabolic.sglUpdateHigherItemScale.disconnect(sltUpdateHigherItemScale);
}
}

View File

@ -62,8 +62,8 @@ Item {
maximumWidth: {
if (showsAudioBadge) {
return height;
} else if ( index === taskItem.indexer.firstVisibleItemIndex && !taskItem.containsMouse) {
return (wrapper.mScale * (taskItem.metrics.iconSize - (root.enableShadows ? shadowSize/2 : 0)));
} else if ( index === taskItem.abilities.indexer.firstVisibleItemIndex && !taskItem.containsMouse) {
return (wrapper.mScale * (taskItem.abilities.metrics.iconSize - (root.enableShadows ? shadowSize/2 : 0)));
} else {
return 999999;
}

View File

@ -25,13 +25,13 @@ import org.kde.latte.components 1.0 as LatteComponents
Loader{
id: shorcutBadge
anchors.fill: iconImageBuffer
active: taskItem.shortcuts.showPositionShortcutBadges && !taskItem.isSeparator && !taskItem.isHidden && taskItem.shortcuts.isEnabled
active: taskItem.abilities.shortcuts.showPositionShortcutBadges && !taskItem.isSeparator && !taskItem.isHidden && taskItem.abilities.shortcuts.isEnabled
asynchronous: true
visible: badgeString !== ""
property int fixedIndex:-1
property string badgeString: (shorcutBadge.fixedIndex>=1 && shorcutBadge.fixedIndex<20 && taskItem.shortcuts.badges.length===19) ?
taskItem.shortcuts.badges[shorcutBadge.fixedIndex-1] : ""
property string badgeString: (shorcutBadge.fixedIndex>=1 && shorcutBadge.fixedIndex<20 && taskItem.abilities.shortcuts.badges.length===19) ?
taskItem.abilities.shortcuts.badges[shorcutBadge.fixedIndex-1] : ""
onActiveChanged: updateShorcutIndex();
@ -41,8 +41,8 @@ Loader{
}
function updateShorcutIndex() {
if (shorcutBadge.active && taskItem.shortcuts.showPositionShortcutBadges) {
fixedIndex = taskItem.shortcuts.shortcutIndex(taskItem.itemIndex);
if (shorcutBadge.active && taskItem.abilities.shortcuts.showPositionShortcutBadges) {
fixedIndex = taskItem.abilities.shortcuts.shortcutIndex(taskItem.itemIndex);
} else {
fixedIndex = -1;
}
@ -67,13 +67,13 @@ Loader{
id: taskNumber
// when iconSize < 48, height is always = 24, height / iconSize > 50%
// we prefer center aligned badges to top-left aligned ones
property bool centerInParent: taskItem.metrics.iconSize < 48
property bool centerInParent: taskItem.abilities.metrics.iconSize < 48
anchors.left: centerInParent? undefined : parent.left
anchors.top: centerInParent? undefined : parent.top
anchors.centerIn: centerInParent? parent : undefined
minimumWidth: 0.4 * (wrapper.mScale * taskItem.metrics.iconSize)
height: Math.max(24, 0.4 * (wrapper.mScale * taskItem.metrics.iconSize))
minimumWidth: 0.4 * (wrapper.mScale * taskItem.abilities.metrics.iconSize)
height: Math.max(24, 0.4 * (wrapper.mScale * taskItem.abilities.metrics.iconSize))
style3d: root.badges3DStyle
textValue: shorcutBadge.badgeString

View File

@ -52,10 +52,10 @@ Item {
if (isSeparator) {
if (root.vertical) {
return taskItem.metrics.totals.thickness + taskItem.metrics.margin.screenEdge;
return taskItem.abilities.metrics.totals.thickness + taskItem.abilities.metrics.margin.screenEdge;
} else {
if (root.dragSource || !taskItem.parabolic.isEnabled) {
return LatteCore.Environment.separatorLength+2*taskItem.metrics.margin.length;
if (root.dragSource || !taskItem.abilities.parabolic.isEnabled) {
return LatteCore.Environment.separatorLength+2*taskItem.abilities.metrics.margin.length;
}
}
@ -79,10 +79,10 @@ Item {
if (isSeparator) {
if (!root.vertical) {
return taskItem.metrics.totals.thickness + taskItem.metrics.margin.screenEdge;
return taskItem.abilities.metrics.totals.thickness + taskItem.abilities.metrics.margin.screenEdge;
} else {
if (root.dragSource || !taskItem.parabolic.isEnabled) {
return LatteCore.Environment.separatorLength+2*taskItem.metrics.margin.length;
if (root.dragSource || !taskItem.abilities.parabolic.isEnabled) {
return LatteCore.Environment.separatorLength+2*taskItem.abilities.metrics.margin.length;
}
}
@ -136,8 +136,8 @@ Item {
readonly property bool isHidden: !visible || isForcedHidden
property bool isForcedHidden: false
property bool isLauncher: (IsLauncher === true) ? true : false
property bool hasShownLauncher: (launchers.inCurrentActivity(taskItem.launcherUrl)
|| launchers.inCurrentActivity(taskItem.launcherUrlWithIcon))
property bool hasShownLauncher: (taskItem.abilities.launchers.inCurrentActivity(taskItem.launcherUrl)
|| taskItem.abilities.launchers.inCurrentActivity(taskItem.launcherUrlWithIcon))
&& !root.inActivityChange /*update trigger when changing current activity*/
property bool isMinimized: (IsMinimized === true) ? true : false
property bool isSeparator: false
@ -145,15 +145,15 @@ Item {
property bool isWindow: (IsWindow === true) ? true : false
property bool isZoomed: false
property bool canPublishGeometries: (isWindow || isStartup || isGroupParent) && visible && width>=taskItem.metrics.iconSize && height>=taskItem.metrics.iconSize
property bool canPublishGeometries: (isWindow || isStartup || isGroupParent) && visible && width>=taskItem.abilities.metrics.iconSize && height>=taskItem.abilities.metrics.iconSize
&& !taskItem.delayingRemove
&& (wrapper.mScale===1 || wrapper.mScale===taskItem.parabolic.factor.zoom) //don't publish during zoom animation
&& (wrapper.mScale===1 || wrapper.mScale===taskItem.abilities.parabolic.factor.zoom) //don't publish during zoom animation
property bool hoveredFromDragging: (mouseHandler.hoveredItem === taskItem) || (mouseHandler.ignoredItem === taskItem)
property bool wheelIsBlocked: false
property int animationTime: (taskItem.animations.active ? taskItem.animations.speedFactor.current : 2) * (1.2 *taskItem.animations.duration.small)
property int animationTime: (taskItem.abilities.animations.active ? taskItem.abilities.animations.speedFactor.current : 2) * (1.2 *taskItem.abilities.animations.duration.small)
property int badgeIndicator: 0 //it is used from external apps
property int itemIndex: index
property int lastValidIndex: -1 //used for the removal animation
@ -161,7 +161,7 @@ Item {
property int pressX: -1
property int pressY: -1
property int resistanceDelay: 450
property int spacersMaxSize: Math.max(0,Math.ceil(0.55*taskItem.metrics.iconSize) - taskItem.metrics.totals.lengthEdges)
property int spacersMaxSize: Math.max(0,Math.ceil(0.55*taskItem.abilities.metrics.iconSize) - taskItem.abilities.metrics.totals.lengthEdges)
property int windowsCount: subWindows.windowsCount
property int windowsMinimizedCount: subWindows.windowsMinimized
@ -193,14 +193,7 @@ Item {
readonly property alias restoreAnimation: _restoreAnimation
//abilities
property Item animations: null
property Item debug: null
property Item indexer: null
property Item launchers: null
property Item metrics: null
property Item parabolic: null
property Item requires: null
property Item shortcuts: null
property Item abilities: null
onModelLauncherUrlChanged: {
if (modelLauncherUrl !== ""){
@ -219,7 +212,7 @@ Item {
}
}
if (launchers.isSeparator(modelLauncherUrl)){
if (taskItem.abilities.launchers.isSeparator(modelLauncherUrl)){
isSeparator = true;
} else {
isSeparator = false;
@ -246,14 +239,14 @@ Item {
var tail = index - 1;
while(tail>=0 && taskItem.indexer.hidden.indexOf(tail)>=0) {
while(tail>=0 && taskItem.abilities.indexer.hidden.indexOf(tail)>=0) {
tail = tail - 1;
}
var hasTailItemSeparator = taskItem.indexer.separators.indexOf(tail)>=0;
var hasTailItemSeparator = taskItem.abilities.indexer.separators.indexOf(tail)>=0;
if (!hasTailItemSeparator && itemIndex === taskItem.indexer.firstVisibleItemIndex){
return taskItem.indexer.tailAppletIsSeparator;
if (!hasTailItemSeparator && itemIndex === taskItem.abilities.indexer.firstVisibleItemIndex){
return taskItem.abilities.indexer.tailAppletIsSeparator;
}
return hasTailItemSeparator;
@ -266,14 +259,14 @@ Item {
var head = index + 1;
while(head>=0 && taskItem.indexer.hidden.indexOf(head)>=0) {
while(head>=0 && taskItem.abilities.indexer.hidden.indexOf(head)>=0) {
head = head + 1;
}
var hasHeadItemSeparator = taskItem.indexer.separators.indexOf(head)>=0;
var hasHeadItemSeparator = taskItem.abilities.indexer.separators.indexOf(head)>=0;
if (!hasHeadItemSeparator && itemIndex === taskItem.indexer.lastVisibleItemIndex){
return taskItem.indexer.headAppletIsSeparator;
if (!hasHeadItemSeparator && itemIndex === taskItem.abilities.indexer.lastVisibleItemIndex){
return taskItem.abilities.indexer.headAppletIsSeparator;
}
return hasHeadItemSeparator;
@ -315,12 +308,12 @@ Item {
Behavior on opacity {
// NumberAnimation { duration: (IsStartup || (IsLauncher) ) ? 0 : 400 }
NumberAnimation { duration: taskItem.animations.speedFactor.current * taskItem.animations.duration.large }
NumberAnimation { duration: taskItem.abilities.animations.speedFactor.current * taskItem.abilities.animations.duration.large }
}
Loader{
anchors.fill: parent
active: taskItem.debug.graphicsEnabled
active: taskItem.abilities.debug.graphicsEnabled
sourceComponent: Rectangle{
anchors.fill: parent
@ -379,7 +372,7 @@ Item {
property real opacityN: isSeparator && root.contextMenu && root.contextMenu.visualParent === taskItem ? 1 : 0
Behavior on opacityN {
NumberAnimation { duration: taskItem.animations.speedFactor.current * taskItem.animations.duration.large }
NumberAnimation { duration: taskItem.abilities.animations.speedFactor.current * taskItem.abilities.animations.duration.large }
}
sourceComponent: Rectangle{
@ -416,15 +409,15 @@ Item {
opacity: (separatorShadow.active) || forceHiddenState ? 0 : 0.4
visible: taskItem.isSeparator
width: root.vertical ? taskItem.metrics.iconSize : ((root.dragSource || root.inEditMode) ? LatteCore.Environment.separatorLength+taskItem.metrics.totals.lengthEdges: 1)
height: !root.vertical ? taskItem.metrics.iconSize : ((root.dragSource || root.inEditMode) ? LatteCore.Environment.separatorLength+taskItem.metrics.totals.lengthEdges: 1)
width: root.vertical ? taskItem.abilities.metrics.iconSize : ((root.dragSource || root.inEditMode) ? LatteCore.Environment.separatorLength+taskItem.abilities.metrics.totals.lengthEdges: 1)
height: !root.vertical ? taskItem.abilities.metrics.iconSize : ((root.dragSource || root.inEditMode) ? LatteCore.Environment.separatorLength+taskItem.abilities.metrics.totals.lengthEdges: 1)
property bool forceHiddenState: false
readonly property int margin: taskItem.metrics.margin.screenEdge + metrics.margin.thickness
readonly property int margin: taskItem.abilities.metrics.margin.screenEdge + taskItem.abilities.metrics.margin.thickness
Behavior on opacity {
NumberAnimation { duration: taskItem.animations.speedFactor.current * taskItem.animations.duration.large }
NumberAnimation { duration: taskItem.abilities.animations.speedFactor.current * taskItem.abilities.animations.duration.large }
}
Connections{
@ -456,8 +449,8 @@ Item {
Rectangle {
anchors.centerIn: parent
width: root.vertical ? taskItem.metrics.iconSize - 4 : 1
height: !root.vertical ? taskItem.metrics.iconSize - 4 : 1
width: root.vertical ? taskItem.abilities.metrics.iconSize - 4 : 1
height: !root.vertical ? taskItem.abilities.metrics.iconSize - 4 : 1
color: enforceLattePalette ? latteBridge.palette.textColor : theme.textColor
}
@ -472,7 +465,7 @@ Item {
opacity: separatorItem.forceHiddenState ? 0 : 0.4
Behavior on opacity {
NumberAnimation { duration: taskItem.animations.speedFactor.current * taskItem.animations.duration.large }
NumberAnimation { duration: taskItem.abilities.animations.speedFactor.current * taskItem.abilities.animations.duration.large }
}
sourceComponent: DropShadow{
@ -532,7 +525,7 @@ Item {
Loader{
anchors.fill: parent
active: taskItem.debug.graphicsEnabled
active: taskItem.abilities.debug.graphicsEnabled
sourceComponent: Rectangle{
color: "transparent"
border.width: 1
@ -559,9 +552,9 @@ Item {
Loader {
id: parabolicAreaLoader
active: taskItem.parabolic.isEnabled
width: root.isHorizontal ? taskItem.width : taskItem.metrics.mask.thickness.zoomedForItems
height: root.isHorizontal ? taskItem.metrics.mask.thickness.zoomedForItems : taskItem.height
active: taskItem.abilities.parabolic.isEnabled
width: root.isHorizontal ? taskItem.width : taskItem.abilities.metrics.mask.thickness.zoomedForItems
height: root.isHorizontal ? taskItem.abilities.metrics.mask.thickness.zoomedForItems : taskItem.height
z:10000
sourceComponent: ParabolicArea{}
@ -617,7 +610,7 @@ Item {
onTriggered: {
slotPublishGeometries();
if (taskItem.debug.timersEnabled) {
if (taskItem.abilities.debug.timersEnabled) {
console.log("plasmoid timer: publishGeometryTimer called...");
}
}
@ -958,7 +951,7 @@ Item {
function slotMimicEnterForParabolic(){
if (containsMouse) {
if (inMimicParabolicAnimation) {
mimicParabolicScale = taskItem.parabolic.factor.zoom;
mimicParabolicScale = taskItem.abilities.parabolic.factor.zoom;
}
if (parabolicAreaLoader.active) {
@ -985,7 +978,7 @@ Item {
var adjX = Math.min(limits.x+limits.width, Math.max(limits.x, globalChoords.x));
var adjY = Math.min(limits.y+limits.height, Math.max(limits.y, globalChoords.y));
var length = taskItem.metrics.iconSize * wrapper.mScale;
var length = taskItem.abilities.metrics.iconSize * wrapper.mScale;
var thickness = length;
//! Magic Lamp effect doesn't like coordinates outside the screen and
@ -1107,7 +1100,7 @@ Item {
function updateVisibilityBasedOnLaunchers(){
var launcherExists = !(((tasksModel.launcherPosition(taskItem.launcherUrl) == -1)
&& (tasksModel.launcherPosition(taskItem.launcherUrlWithIcon) == -1) )
|| !taskItem.launchers.inCurrentActivity(taskItem.launcherUrl));
|| !taskItem.abilities.launchers.inCurrentActivity(taskItem.launcherUrl));
if (root.showWindowsOnlyFromLaunchers || root.disableAllWindowsFunctionality) {
var hideWindow = !launcherExists && (taskItem.isWindow || root.disableAllWindowsFunctionality);
@ -1179,13 +1172,13 @@ Item {
}
Connections {
target: shortcuts
target: taskItem.abilities.shortcuts
onSglActivateEntryAtIndex: {
if (!taskItem.shortcuts.isEnabled) {
if (!taskItem.abilities.shortcuts.isEnabled) {
return;
}
var shortcutIndex = taskItem.shortcuts.shortcutIndex(taskItem.itemIndex);
var shortcutIndex = taskItem.abilities.shortcuts.shortcutIndex(taskItem.itemIndex);
if (shortcutIndex === entryIndex) {
if (taskItem.isGroupParent) {
@ -1197,11 +1190,11 @@ Item {
}
onSglNewInstanceForEntryAtIndex: {
if (!taskItem.shortcuts.isEnabled) {
if (!taskItem.abilities.shortcuts.isEnabled) {
return;
}
var shortcutIndex = taskItem.shortcuts.shortcutIndex(taskItem.itemIndex);
var shortcutIndex = taskItem.abilities.shortcuts.shortcutIndex(taskItem.itemIndex);
if (shortcutIndex === entryIndex) {
tasksModel.requestNewInstance(taskItem.modelIndex());
@ -1233,12 +1226,12 @@ Item {
root.showPreviewForTasks.connect(slotShowPreviewForTasks);
root.mimicEnterForParabolic.connect(slotMimicEnterForParabolic);
launchers.launcherChanged.connect(onLauncherChanged);
launchers.launcherRemoved.connect(onLauncherChanged);
parabolic.sglClearZoom.connect(sltClearZoom);
taskItem.abilities.launchers.launcherChanged.connect(onLauncherChanged);
taskItem.abilities.launchers.launcherRemoved.connect(onLauncherChanged);
taskItem.abilities.parabolic.sglClearZoom.connect(sltClearZoom);
//startup without launcher
var hideStartup = ((!hasShownLauncher || !taskItem.launchers.inCurrentActivity(taskItem.launcherUrl))
var hideStartup = ((!hasShownLauncher || !taskItem.abilities.launchers.inCurrentActivity(taskItem.launcherUrl))
&& taskItem.isStartup);
if (!LatteCore.WindowSystem.compositingActive) {
@ -1262,9 +1255,9 @@ Item {
root.showPreviewForTasks.disconnect(slotShowPreviewForTasks);
root.mimicEnterForParabolic.disconnect(slotMimicEnterForParabolic);
launchers.launcherChanged.disconnect(onLauncherChanged);
launchers.launcherRemoved.disconnect(onLauncherChanged);
parabolic.sglClearZoom.disconnect(sltClearZoom);
taskItem.abilities.launchers.launcherChanged.disconnect(onLauncherChanged);
taskItem.abilities.launchers.launcherRemoved.disconnect(onLauncherChanged);
taskItem.abilities.parabolic.sglClearZoom.disconnect(sltClearZoom);
tasksExtendedManager.waitingLauncherRemoved.disconnect(slotWaitingLauncherRemoved);
@ -1289,7 +1282,7 @@ Item {
taskItem.lastValidIndex = taskItem.itemIndex;
}
if (taskItem.debug.timersEnabled) {
if (taskItem.abilities.debug.timersEnabled) {
console.log("plasmoid timer: lastValidTimer called...");
}
}

View File

@ -356,7 +356,7 @@ MouseArea {
taskItem.isDragged = true;
}
if (taskItem.debug.timersEnabled) {
if (taskItem.abilities.debug.timersEnabled) {
console.log("plasmoid timer: resistanerTimer called...");
}
}

View File

@ -36,13 +36,13 @@ Item{
if (!root.vertical)
return 0;
else
return (taskItem.metrics.iconSize + root.widthMargins + taskItem.metrics.margin.screenEdge);
return (taskItem.abilities.metrics.iconSize + root.widthMargins + taskItem.abilities.metrics.margin.screenEdge);
}
if (taskItem.isStartup && taskItem.animations.speedFactor.current !==0 ) {
return root.vertical ? cleanScalingWidth + taskItem.metrics.margin.screenEdge : cleanScalingWidth;
if (taskItem.isStartup && taskItem.abilities.animations.speedFactor.current !==0 ) {
return root.vertical ? cleanScalingWidth + taskItem.abilities.metrics.margin.screenEdge : cleanScalingWidth;
} else {
return root.vertical ? showDelegateWidth + taskItem.metrics.margin.screenEdge : showDelegateWidth;
return root.vertical ? showDelegateWidth + taskItem.abilities.metrics.margin.screenEdge : showDelegateWidth;
}
}
@ -54,18 +54,18 @@ Item{
if (root.vertical)
return 0;
else
return (taskItem.metrics.iconSize + root.heightMargins + taskItem.metrics.margin.screenEdge);
return (taskItem.abilities.metrics.iconSize + root.heightMargins + taskItem.abilities.metrics.margin.screenEdge);
}
if (taskItem.isStartup && taskItem.animations.speedFactor.current !==0){
return !root.vertical ? cleanScalingHeight + taskItem.metrics.margin.screenEdge : cleanScalingHeight;
if (taskItem.isStartup && taskItem.abilities.animations.speedFactor.current !==0){
return !root.vertical ? cleanScalingHeight + taskItem.abilities.metrics.margin.screenEdge : cleanScalingHeight;
} else {
return !root.vertical ? showDelegateHeight + taskItem.metrics.margin.screenEdge : showDelegateHeight;
return !root.vertical ? showDelegateHeight + taskItem.abilities.metrics.margin.screenEdge : showDelegateHeight;
}
}
property int maxThickness: !root.vertical ? taskItem.parabolic.factor.zoom*(taskItem.metrics.iconSize+root.heightMargins)
: taskItem.parabolic.factor.zoom*(taskItem.metrics.iconSize+root.widthMargins)
property int maxThickness: !root.vertical ? taskItem.abilities.parabolic.factor.zoom*(taskItem.abilities.metrics.iconSize+root.heightMargins)
: taskItem.abilities.parabolic.factor.zoom*(taskItem.abilities.metrics.iconSize+root.widthMargins)
property real showDelegateWidth: basicScalingWidth
property real showDelegateHeight: basicScalingHeight
@ -81,17 +81,17 @@ Item{
property real scaleWidth: (inTempScaling == true) ? tempScaleWidth : mScale
property real scaleHeight: (inTempScaling == true) ? tempScaleHeight : mScale
property real cleanScalingWidth: (taskItem.metrics.iconSize + root.widthMargins) * mScale
property real cleanScalingHeight: (taskItem.metrics.iconSize + root.heightMargins) * mScale
property real cleanScalingWidth: (taskItem.abilities.metrics.iconSize + root.widthMargins) * mScale
property real cleanScalingHeight: (taskItem.abilities.metrics.iconSize + root.heightMargins) * mScale
property real basicScalingWidth : (inTempScaling == true) ? ((taskItem.metrics.iconSize + root.widthMargins) * scaleWidth) : cleanScalingWidth
property real basicScalingHeight : (inTempScaling == true) ? ((taskItem.metrics.iconSize + root.heightMargins) * scaleHeight) : cleanScalingHeight
property real basicScalingWidth : (inTempScaling == true) ? ((taskItem.abilities.metrics.iconSize + root.widthMargins) * scaleWidth) : cleanScalingWidth
property real basicScalingHeight : (inTempScaling == true) ? ((taskItem.abilities.metrics.iconSize + root.heightMargins) * scaleHeight) : cleanScalingHeight
property real regulatorWidth: taskItem.isSeparator ? width : basicScalingWidth;
property real regulatorHeight: taskItem.isSeparator ? height : basicScalingHeight;
property real visualScaledWidth: (taskItem.metrics.iconSize + root.internalWidthMargins) * mScale
property real visualScaledHeight: (taskItem.metrics.iconSize + root.internalHeightMargins) * mScale
property real visualScaledWidth: (taskItem.abilities.metrics.iconSize + root.internalWidthMargins) * mScale
property real visualScaledHeight: (taskItem.abilities.metrics.iconSize + root.internalHeightMargins) * mScale
/// end of Scalers///////
property real center: !root.vertical ?
@ -120,7 +120,7 @@ Item{
Behavior on mScale {
id: animatedBehavior
enabled: !taskItem.parabolic.directRenderingEnabled || inMimicParabolicAnimation || restoreAnimation.running
enabled: !taskItem.abilities.parabolic.directRenderingEnabled || inMimicParabolicAnimation || restoreAnimation.running
NumberAnimation{
duration: 3 * taskItem.animationTime
easing.type: Easing.OutCubic
@ -142,10 +142,10 @@ Item{
anchors.horizontalCenter: !root.vertical ? parent.horizontalCenter : undefined
anchors.verticalCenter: root.vertical ? parent.verticalCenter : undefined
anchors.bottomMargin: (root.location === PlasmaCore.Types.BottomEdge) ? taskItem.metrics.margin.screenEdge : 0
anchors.topMargin: (root.location === PlasmaCore.Types.TopEdge) ? taskItem.metrics.margin.screenEdge : 0
anchors.leftMargin: (root.location === PlasmaCore.Types.LeftEdge) ? taskItem.metrics.margin.screenEdge : 0
anchors.rightMargin: (root.location === PlasmaCore.Types.RightEdge) ? taskItem.metrics.margin.screenEdge : 0
anchors.bottomMargin: (root.location === PlasmaCore.Types.BottomEdge) ? taskItem.abilities.metrics.margin.screenEdge : 0
anchors.topMargin: (root.location === PlasmaCore.Types.TopEdge) ? taskItem.abilities.metrics.margin.screenEdge : 0
anchors.leftMargin: (root.location === PlasmaCore.Types.LeftEdge) ? taskItem.abilities.metrics.margin.screenEdge : 0
anchors.rightMargin: (root.location === PlasmaCore.Types.RightEdge) ? taskItem.abilities.metrics.margin.screenEdge : 0
anchors.horizontalCenterOffset: taskItem.iconOffsetX
anchors.verticalCenterOffset: taskItem.iconOffsetY
@ -157,13 +157,13 @@ Item{
function sendEndOfNeedBothAxisAnimation(){
if (taskItem.isZoomed) {
taskItem.isZoomed = false;
taskItem.animations.needBothAxis.removeEvent(bothAxisZoomEvent);
taskItem.abilities.animations.needBothAxis.removeEvent(bothAxisZoomEvent);
}
}
onMScaleChanged: {
if ((mScale === taskItem.parabolic.factor.zoom) && !taskItem.parabolic.directRenderingEnabled) {
taskItem.parabolic.setDirectRenderingEnabled(true);
if ((mScale === taskItem.abilities.parabolic.factor.zoom) && !taskItem.abilities.parabolic.directRenderingEnabled) {
taskItem.abilities.parabolic.setDirectRenderingEnabled(true);
}
if (inMimicParabolicAnimation){
@ -173,7 +173,7 @@ Item{
inBlockingAnimation = false;
mimicParabolicScale = -1;
} else {
var tempScale = (taskItem.parabolic.factor.zoom - mScale) / 2;
var tempScale = (taskItem.abilities.parabolic.factor.zoom - mScale) / 2;
hiddenSpacerLeft.nScale = tempScale;
hiddenSpacerRight.nScale = tempScale;
@ -182,7 +182,7 @@ Item{
if ((mScale > 1) && !taskItem.isZoomed) {
taskItem.isZoomed = true;
taskItem.animations.needBothAxis.addEvent(bothAxisZoomEvent);
taskItem.abilities.animations.needBothAxis.addEvent(bothAxisZoomEvent);
} else if ((mScale == 1) && taskItem.isZoomed) {
sendEndOfNeedBothAxisAnimation();
}

View File

@ -27,8 +27,8 @@ SequentialAnimation{
id: clickedAnimation
property bool pressed: taskItem.pressed
property int speed: taskItem.animations.speedFactor.current * taskItem.animations.duration.large
property real maxMScale: Math.max(1,taskItem.parabolic.factor.zoom - (taskItem.parabolic.factor.zoom - 1) / 2)
property int speed: taskItem.abilities.animations.speedFactor.current * taskItem.abilities.animations.duration.large
property real maxMScale: Math.max(1,taskItem.abilities.parabolic.factor.zoom - (taskItem.abilities.parabolic.factor.zoom - 1) / 2)
ParallelAnimation{
PropertyAnimation {
@ -41,7 +41,7 @@ SequentialAnimation{
/* PropertyAnimation {
target: wrapper
property: "mScale"
to: root.taskInAnimation ? 1 : Math.max(clickedAnimation.maxMScale, wrapper.mScale - (taskItem.parabolic.factor.zoom - 1) / 2)
to: root.taskInAnimation ? 1 : Math.max(clickedAnimation.maxMScale, wrapper.mScale - (taskItem.abilities.parabolic.factor.zoom - 1) / 2)
duration: clickedAnimation.speed
easing.type: Easing.OutQuad
}*/
@ -58,7 +58,7 @@ SequentialAnimation{
/* PropertyAnimation {
target: wrapper
property: "mScale"
to: root.taskInAnimation ? 1 : taskItem.parabolic.factor.zoom
to: root.taskInAnimation ? 1 : taskItem.abilities.parabolic.factor.zoom
duration: clickedAnimation.speed
easing.type: Easing.OutQuad
}*/
@ -68,7 +68,7 @@ SequentialAnimation{
onPressedChanged: {
if(!running && pressed && !indicators.info.providesClickedAnimation &&
((taskItem.lastButtonClicked == Qt.LeftButton)||(taskItem.lastButtonClicked == Qt.MidButton)) ){
//taskItem.animationStarted();
//taskItem.abilities.animationstarted();
start();
}
}
@ -77,7 +77,7 @@ SequentialAnimation{
if( !taskItem.isDragged){
//taskItem.animationEnded();
if(!root.latteView)
checkListHovered.startDuration(6 * taskItem.animations.duration.large);
checkListHovered.startDuration(6 * taskItem.abilities.animations.duration.large);
}
}
}

View File

@ -27,7 +27,7 @@ import org.kde.plasma.plasmoid 2.0
Item{
id:launcherAnimation
property bool launchedAlready: false
property int speed: 0.9 * taskItem.animations.speedFactor.current * taskItem.animations.duration.large
property int speed: 0.9 * taskItem.abilities.animations.speedFactor.current * taskItem.abilities.animations.duration.large
readonly property string needThicknessEvent: launcherAnimation + "_launcher"
@ -45,7 +45,7 @@ Item{
tasksExtendedManager.removeWaitingLauncher(taskItem.launcherUrl);
}
taskItem.parabolic.setDirectRenderingEnabled(false);
taskItem.abilities.parabolic.setDirectRenderingEnabled(false);
clearAnimationsSignals();
taskItem.setBlockingAnimation(false);
@ -59,7 +59,7 @@ Item{
}
if ( launchedAlready ) {
taskItem.animations.needThickness.removeEvent(needThicknessEvent);
taskItem.abilities.animations.needThickness.removeEvent(needThicknessEvent);
}
launchedAlready = false;
@ -69,9 +69,9 @@ Item{
//console.log ("Nooo 1 : "+root.noTasksInAnimation);
if(!launchedAlready) {
launchedAlready = true;
taskItem.animations.needThickness.addEvent(needThicknessEvent);
taskItem.abilities.animations.needThickness.addEvent(needThicknessEvent);
taskItem.parabolic.setDirectRenderingEnabled(false);
taskItem.abilities.parabolic.setDirectRenderingEnabled(false);
root.noTasksInAnimation++;
taskItem.inBouncingAnimation = true;
@ -94,8 +94,8 @@ Item{
}
function startLauncherAnimation(){
if(taskItem.animations.launcherBouncingEnabled){
taskItem.animationStarted();
if(taskItem.abilities.animations.launcherBouncingEnabled){
taskItem.abilities.animationstarted();
init();
taskItem.launcherAction();
launcherAnimationLoader.item.start();

View File

@ -28,7 +28,7 @@ import org.kde.plasma.core 2.0 as PlasmaCore
Item{
id:newWindowAnimation
property int speed: 1.2 * taskItem.animations.speedFactor.normal * taskItem.animations.duration.large
property int speed: 1.2 * taskItem.abilities.animations.speedFactor.normal * taskItem.abilities.animations.duration.large
property bool isDemandingAttention: taskItem.inAttention
property bool containsMouse: taskItem.containsMouse
@ -43,7 +43,7 @@ Item{
target: newWindowAnimationLoader.item
onStopped: {
taskItem.animations.needThickness.removeEvent(needThicknessEvent);
taskItem.abilities.animations.needThickness.removeEvent(needThicknessEvent);
newWindowAnimation.clear();
}
}
@ -81,12 +81,12 @@ Item{
taskItem.inAttentionAnimation = true;
}
taskItem.animations.needThickness.addEvent(needThicknessEvent);
taskItem.abilities.animations.needThickness.addEvent(needThicknessEvent);
}
function startNewWindowAnimation(){
if (!root.dockIsHidden && ((taskItem.animations.windowInAttentionEnabled && isDemandingAttention)
|| taskItem.animations.windowAddedInGroupEnabled)){
if (!root.dockIsHidden && ((taskItem.abilities.animations.windowInAttentionEnabled && isDemandingAttention)
|| taskItem.abilities.animations.windowAddedInGroupEnabled)){
newWindowAnimation.init();
newWindowAnimationLoader.item.start();
}
@ -98,6 +98,6 @@ Item{
Component.onDestruction: {
taskItem.groupWindowAdded.disconnect(startNewWindowAnimation);
taskItem.animations.needThickness.removeEvent(needThicknessEvent);
taskItem.abilities.animations.needThickness.removeEvent(needThicknessEvent);
}
}

View File

@ -36,8 +36,8 @@ SequentialAnimation {
//Animation Add/Remove (4) - the user removes a launcher, animation enabled
property bool animation1: ( (tasksModel.launcherPosition(taskItem.launcherUrl) === -1 /*no-launcher*/
&& tasksModel.launcherPosition(taskItem.launcherUrlWithIcon) === -1)
|| ((!taskItem.launchers.inCurrentActivity(taskItem.launcherUrl)/*no-launcher-in-current-activity*/
&& !taskItem.launchers.inCurrentActivity(taskItem.launcherUrlWithIcon)))
|| ((!taskItem.abilities.launchers.inCurrentActivity(taskItem.launcherUrl)/*no-launcher-in-current-activity*/
&& !taskItem.abilities.launchers.inCurrentActivity(taskItem.launcherUrlWithIcon)))
&& !taskItem.isStartup
&& LatteCore.WindowSystem.compositingActive)
@ -48,7 +48,7 @@ SequentialAnimation {
&& LatteCore.WindowSystem.compositingActive)
property bool enabledAnimation: (animation1 || animation4)
&& (taskItem.animations.newWindowSlidingEnabled)
&& (taskItem.abilities.animations.newWindowSlidingEnabled)
&& !taskItem.inBouncingAnimation
&& !taskItem.isSeparator
&& taskItem.visible
@ -59,8 +59,8 @@ SequentialAnimation {
script:{
//! When a window is removed and afterwards its launcher must be shown immediately!
if (!enabledAnimation && taskItem.isWindow && !taskItem.isSeparator
&& (taskItem.launchers.inCurrentActivity(taskItem.launcherUrl)
|| taskItem.launchers.inCurrentActivity(taskItem.launcherUrlWithIcon))
&& (taskItem.abilities.launchers.inCurrentActivity(taskItem.launcherUrl)
|| taskItem.abilities.launchers.inCurrentActivity(taskItem.launcherUrlWithIcon))
&& !tasksExtendedManager.immediateLauncherExists(taskItem.launcherUrl)){
tasksExtendedManager.addImmediateLauncher(taskItem.launcherUrl);
}
@ -72,7 +72,7 @@ SequentialAnimation {
//! 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 spacer = taskItem.headItemIsSeparator ? -(2+taskItem.metrics.totals.lengthEdge) : ( taskItem.headItemIsSeparator ? (2+taskItem.metrics.totals.lengthEdge)/2 : 0);
var spacer = taskItem.headItemIsSeparator ? -(2+taskItem.abilities.metrics.totals.lengthEdge) : ( taskItem.headItemIsSeparator ? (2+taskItem.abilities.metrics.totals.lengthEdge)/2 : 0);
if (!taskItem.inBouncingAnimation && !animation4) {
//! real slide-out case
@ -109,11 +109,11 @@ SequentialAnimation {
}
}
//console.log("1." + taskItem.launcherUrl + " - " + taskItem.launchers.inCurrentActivity(taskItem.launcherUrl) + "__" +
//console.log("1." + taskItem.launcherUrl + " - " + taskItem.abilities.launchers.inCurrentActivity(taskItem.launcherUrl) + "__" +
// animation1 + ":" + animation4 + "=>" + taskRealRemovalAnimation.enabledAnimation);
//console.log("2." + taskItem.isLauncher);
taskItem.animations.needLength.addEvent(needLengthEvent);
taskItem.abilities.animations.needLength.addEvent(needLengthEvent);
if (wrapper.mScale > 1 && !taskRealRemovalAnimation.enabledAnimation
&& !taskItem.inBouncingAnimation && LatteCore.WindowSystem.compositingActive) {
@ -134,7 +134,7 @@ SequentialAnimation {
duration: taskItem.inBouncingAnimation && !taskItem.isSeparator? 4*launcherSpeedStep + 50 : 0
easing.type: Easing.InQuad
property int launcherSpeedStep: 0.8 * taskItem.animations.speedFactor.current * taskItem.animations.duration.large
property int launcherSpeedStep: 0.8 * taskItem.abilities.animations.speedFactor.current * taskItem.abilities.animations.duration.large
}
//end of ghost animation
@ -184,10 +184,10 @@ SequentialAnimation {
if (showWindowAnimation.animationSent){
//console.log("SAFETY REMOVAL 1: animation removing ended");
showWindowAnimation.animationSent = false;
taskItem.animations.needLength.removeEvent(showWindowAnimation.needLengthEvent);
taskItem.abilities.animations.needLength.removeEvent(showWindowAnimation.needLengthEvent);
}
taskItem.animations.needLength.removeEvent(needLengthEvent);
taskItem.abilities.animations.needLength.removeEvent(needLengthEvent);
if(tasksExtendedManager.isLauncherToBeRemoved(taskItem.launcherUrl) && taskItem.isLauncher) {
tasksExtendedManager.removeToBeRemovedLauncher(taskItem.launcherUrl);
@ -213,7 +213,7 @@ SequentialAnimation {
//send signal that the launcher is really removing
if (taskItem.inBouncingAnimation) {
tasksExtendedManager.removeWaitingLauncher(taskItem.launcherUrl);
taskItem.parabolic.setDirectRenderingEnabled(false);
taskItem.abilities.parabolic.setDirectRenderingEnabled(false);
}
}
}

View File

@ -41,7 +41,7 @@ Item{
}
function removeTask(){
if(!taskIcon.toBeDestroyed && taskItem.animations.windowRemovedFromGroupEnabled){
if(!taskIcon.toBeDestroyed && taskItem.abilities.animations.windowRemovedFromGroupEnabled){
removingAnimation.init();
}
}
@ -67,10 +67,10 @@ Item{
LatteCore.IconItem{
id: tempRemoveIcon
anchors.rightMargin: root.location === PlasmaCore.Types.LeftEdge ? taskItem.metrics.margin.thickness : 0
anchors.leftMargin: root.location === PlasmaCore.Types.RightEdge ? taskItem.metrics.margin.thickness : 0
anchors.topMargin: root.location === PlasmaCore.Types.BottomEdge ? taskItem.metrics.margin.thickness : 0
anchors.bottomMargin: root.location === PlasmaCore.Types.TopEdge ? taskItem.metrics.margin.thickness : 0
anchors.rightMargin: root.location === PlasmaCore.Types.LeftEdge ? taskItem.abilities.metrics.margin.thickness : 0
anchors.leftMargin: root.location === PlasmaCore.Types.RightEdge ? taskItem.abilities.metrics.margin.thickness : 0
anchors.topMargin: root.location === PlasmaCore.Types.BottomEdge ? taskItem.abilities.metrics.margin.thickness : 0
anchors.bottomMargin: root.location === PlasmaCore.Types.TopEdge ? taskItem.abilities.metrics.margin.thickness : 0
anchors.horizontalCenter: !root.vertical ? parent.horizontalCenter : undefined;
anchors.verticalCenter: root.vertical ? parent.verticalCenter : undefined;
@ -114,7 +114,7 @@ Item{
ParallelAnimation{
id: componentRemoveAnimation
property int speed: 2 * taskItem.animations.speedFactor.normal * taskItem.animations.duration.large
property int speed: 2 * taskItem.abilities.animations.speedFactor.normal * taskItem.abilities.animations.duration.large
property Item removingItem: parent
property int toPoint: 0
@ -149,10 +149,10 @@ Item{
if( (root.location === PlasmaCore.Types.BottomEdge) ||
(root.location === PlasmaCore.Types.RightEdge) ){
componentRemoveAnimation.toPoint = tempPoint + taskItem.metrics.iconSize;
componentRemoveAnimation.toPoint = tempPoint + taskItem.abilities.metrics.iconSize;
}
else{
componentRemoveAnimation.toPoint = tempPoint - taskItem.metrics.iconSize;
componentRemoveAnimation.toPoint = tempPoint - taskItem.abilities.metrics.iconSize;
}
visible = true;

View File

@ -27,7 +27,7 @@ import org.kde.latte.core 0.2 as LatteCore
///item's added Animation
SequentialAnimation{
id:showWindowAnimation
property int speed: taskItem.animations.newWindowSlidingEnabled ? (1.2 * taskItem.animations.speedFactor.normal * taskItem.animations.duration.large) : 0
property int speed: taskItem.abilities.animations.newWindowSlidingEnabled ? (1.2 * taskItem.abilities.animations.speedFactor.normal * taskItem.abilities.animations.duration.large) : 0
property bool animationSent: false
readonly property string needLengthEvent: showWindowAnimation + "_showwindow"
@ -38,7 +38,7 @@ SequentialAnimation{
property: "opacity"
to: 0
//it is not depend to durationTime when animations are active
duration: taskItem.animations.newWindowSlidingEnabled ? 750 : 0
duration: taskItem.abilities.animations.newWindowSlidingEnabled ? 750 : 0
easing.type: Easing.InQuad
}
//end of ghost animation
@ -47,7 +47,7 @@ SequentialAnimation{
script:{
if (!showWindowAnimation.animationSent) {
showWindowAnimation.animationSent = true;
taskItem.animations.needLength.addEvent(needLengthEvent);
taskItem.abilities.animations.needLength.addEvent(needLengthEvent);
}
}
}
@ -97,7 +97,7 @@ SequentialAnimation{
taskItem.inAnimation = false;
if (showWindowAnimation.animationSent) {
taskItem.animations.needLength.removeEvent(needLengthEvent);
taskItem.abilities.animations.needLength.removeEvent(needLengthEvent);
showWindowAnimation.animationSent = false;
}
}
@ -124,7 +124,7 @@ SequentialAnimation{
//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 || !taskItem.launchers.inCurrentActivity(taskItem.launcherUrl))
var animation2 = ((!hasShownLauncher || !taskItem.abilities.launchers.inCurrentActivity(taskItem.launcherUrl))
&& taskItem.isWindow
&& LatteCore.WindowSystem.compositingActive);
@ -140,7 +140,7 @@ SequentialAnimation{
//startup without launcher, animation should be blocked
var launcherExists = !(!hasShownLauncher || !taskItem.launchers.inCurrentActivity(taskItem.launcherUrl));
var launcherExists = !(!hasShownLauncher || !taskItem.abilities.launchers.inCurrentActivity(taskItem.launcherUrl));
//var hideStartup = launcherExists && taskItem.isStartup; //! fix #976
var hideWindow = (root.showWindowsOnlyFromLaunchers || root.disableAllWindowsFunctionality) && !launcherExists && taskItem.isWindow;
@ -167,7 +167,7 @@ SequentialAnimation{
wrapper.opacity = 1;
taskItem.inAnimation = false;
} else if (( animation2 || animation3 || animation6 || isForcedHidden)
&& (taskItem.animations.speedFactor.current !== 0) && !launcherIsAlreadyShown){
&& (taskItem.abilities.animations.speedFactor.current !== 0) && !launcherIsAlreadyShown){
isForcedHidden = false;
taskItem.visible = true;
wrapper.tempScaleWidth = 0;
@ -200,7 +200,7 @@ SequentialAnimation{
if (animationSent){
//console.log("SAFETY REMOVAL 2: animation removing ended");
animationSent = false;
taskItem.animations.needLength.removeEvent(needLengthEvent);
taskItem.abilities.animations.needLength.removeEvent(needLengthEvent);
}
}
}

View File

@ -36,7 +36,7 @@ SequentialAnimation{
PropertyAnimation {
target: wrapper
property: (icList.orientation == Qt.Vertical) ? "tempScaleWidth" : "tempScaleHeight"
to: taskItem.containsMouse ? 1+2*(taskItem.parabolic.factor.maxZoom-1) : 1 + (1.5 * (taskItem.parabolic.factor.maxZoom-1))
to: taskItem.containsMouse ? 1+2*(taskItem.abilities.parabolic.factor.maxZoom-1) : 1 + (1.5 * (taskItem.abilities.parabolic.factor.maxZoom-1))
duration: launcherAnimation.speed
easing.type: Easing.OutQuad
}
@ -63,7 +63,7 @@ SequentialAnimation{
target: wrapper
property: (icList.orientation === Qt.Vertical) ? "tempScaleHeight" : "tempScaleWidth"
to: 1
duration: taskItem.animations.speedFactor.current*launcherAnimation.speed
duration: taskItem.abilities.animations.speedFactor.current*launcherAnimation.speed
easing.type: Easing.OutBounce
}
@ -71,7 +71,7 @@ SequentialAnimation{
target: wrapper
property: "mScale"
to: 1
duration: taskItem.animations.speedFactor.current*launcherAnimation.speed
duration: taskItem.abilities.animations.speedFactor.current*launcherAnimation.speed
easing.type: Easing.OutQuad
}
}

View File

@ -28,7 +28,7 @@ SequentialAnimation{
PropertyAnimation {
target: wrapper
property: (icList.orientation == Qt.Vertical) ? "tempScaleWidth" : "tempScaleHeight"
to: 1 + (thickPercentage * 2 * (taskItem.animations.requirements.zoomFactor-1))
to: 1 + (thickPercentage * 2 * (taskItem.abilities.animations.requirements.zoomFactor-1))
duration: newWindowAnimation.speed
easing.type: Easing.OutQuad

View File

@ -60,19 +60,19 @@ Item {
readonly property int windowsCount: taskIsValid && !root.disableAllWindowsFunctionality ? taskItem.windowsCount : 0
readonly property int windowsMinimizedCount: taskIsValid && !root.disableAllWindowsFunctionality ? taskItem.windowsMinimizedCount : 0
readonly property int currentIconSize: taskIsValid ? taskItem.metrics.iconSize : metrics.iconSize
readonly property int maxIconSize: taskIsValid ? taskItem.metrics.maxIconSize : metrics.iconSize
readonly property int currentIconSize: taskIsValid ? taskItem.abilities.metrics.iconSize : metrics.iconSize
readonly property int maxIconSize: taskIsValid ? taskItem.abilities.metrics.maxIconSize : metrics.iconSize
readonly property real scaleFactor: taskIsValid ? taskItem.wrapper.mScale : 1
readonly property real panelOpacity: root.currentPanelOpacity
readonly property color shadowColor: root.appShadowColorSolid
readonly property bool animationsEnabled: taskIsValid ? taskItem.animations.active : appletAbilities.animations.active
readonly property real durationTime: taskIsValid ? taskItem.animations.speedFactor.current : appletAbilities.animations.speedFactor.current
readonly property bool animationsEnabled: taskIsValid ? taskItem.abilities.animations.active : appletAbilities.animations.active
readonly property real durationTime: taskIsValid ? taskItem.abilities.animations.speedFactor.current : appletAbilities.animations.speedFactor.current
readonly property bool progressVisible: wrapper.progressVisible /*since 0.9.2*/
readonly property real progress: wrapper.progress /*since 0.9.2*/
readonly property int screenEdgeMargin: taskIsValid ? taskItem.metrics.margin.screenEdge : metrics.margin.screenEdge /*since 0.10*/
readonly property int screenEdgeMargin: taskIsValid ? taskItem.abilities.metrics.margin.screenEdge : metrics.margin.screenEdge /*since 0.10*/
readonly property variant svgs: indicators ? indicators.svgs : []

View File

@ -45,7 +45,7 @@ Loader {
return visualLockedWidth;
}
return !root.vertical ? taskItem.wrapper.width - 2*taskItem.wrapper.mScale*taskItem.metrics.margin.length: taskItem.wrapper.width;
return !root.vertical ? taskItem.wrapper.width - 2*taskItem.wrapper.mScale*taskItem.abilities.metrics.margin.length: taskItem.wrapper.width;
}
height: {
@ -53,15 +53,15 @@ Loader {
return visualLockedHeight;
}
return root.vertical ? taskItem.wrapper.height - 2*taskItem.wrapper.mScale*taskItem.metrics.margin.length : taskItem.wrapper.height;
return root.vertical ? taskItem.wrapper.height - 2*taskItem.wrapper.mScale*taskItem.abilities.metrics.margin.length : taskItem.wrapper.height;
}
readonly property bool locked: inAttentionAnimation || inNewWindowAnimation || inBouncingAnimation
property real visualLockedWidth: root.vertical ? taskItem.metrics.margin.screenEdge + taskItem.metrics.iconSize + root.internalWidthMargins :
taskItem.metrics.iconSize + root.internalWidthMargins
property real visualLockedHeight: !root.vertical ? taskItem.metrics.margin.screenEdge + taskItem.metrics.iconSize + root.internalHeightMargins :
taskItem.metrics.iconSize + root.internalHeightMargins
property real visualLockedWidth: root.vertical ? taskItem.abilities.metrics.margin.screenEdge + taskItem.abilities.metrics.iconSize + root.internalWidthMargins :
taskItem.abilities.metrics.iconSize + root.internalWidthMargins
property real visualLockedHeight: !root.vertical ? taskItem.abilities.metrics.margin.screenEdge + taskItem.abilities.metrics.iconSize + root.internalHeightMargins :
taskItem.abilities.metrics.iconSize + root.internalHeightMargins
//! Connections !//