references improvements for Tasks applet

pull/15/head
Michail Vourlakos 5 years ago
parent 368b4b8441
commit 4237bd44b6

@ -1266,6 +1266,7 @@ Item {
orientation: plasmoid.formFactor === PlasmaCore.Types.Vertical ? Qt.Vertical : Qt.Horizontal
delegate: Task.TaskItem{
animations: _animations
container: _container
}
property int currentSpot : -1000

@ -63,7 +63,7 @@ Item{
} else if (!inAttentionAnimation && !inMimicParabolicAnimation && !inFastRestoreAnimation) {
return (nScale > 0) ? (taskItem.spacersMaxSize * nScale) + separatorSpace : separatorSpace;
} else {
return (nScale > 0) ? (container.iconSize * nScale) + separatorSpace : separatorSpace;
return (nScale > 0) ? (taskItem.container.iconSize * nScale) + separatorSpace : separatorSpace;
}
}
}

@ -118,12 +118,12 @@ Item{
TitleTooltipParent{
id: titleTooltipParent
thickness: root.zoomFactor * (container.iconSize + root.thickMargins)
thickness: root.zoomFactor * (taskItem.container.iconSize + root.thickMargins)
}
TitleTooltipParent{
id: previewsTooltipParent
thickness: root.zoomFactor * (container.iconSize + root.thickMargins) + 1
thickness: root.zoomFactor * (taskItem.container.iconSize + root.thickMargins) + 1
}
//!
@ -185,12 +185,12 @@ Item{
}
}
property int zoomedSize: root.zoomFactor * container.iconSize
property int zoomedSize: root.zoomFactor * taskItem.container.iconSize
property real basicScalingWidth : wrapper.inTempScaling ? (container.iconSize * wrapper.scaleWidth) :
container.iconSize * wrapper.mScale
property real basicScalingHeight : wrapper.inTempScaling ? (container.iconSize * wrapper.scaleHeight) :
container.iconSize * wrapper.mScale
property real basicScalingWidth : wrapper.inTempScaling ? (taskItem.container.iconSize * wrapper.scaleWidth) :
taskItem.container.iconSize * wrapper.mScale
property real basicScalingHeight : wrapper.inTempScaling ? (taskItem.container.iconSize * wrapper.scaleHeight) :
taskItem.container.iconSize * wrapper.mScale
property real newTempSize: {
if (wrapper.opacity === 1 ) {
@ -254,7 +254,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.animations.speedFactor.current * taskItem.animations.duration.large }
}
]
} //IconImageBuffer
@ -296,7 +296,7 @@ Item{
property bool showAudio: (root.showAudioBadge && taskItem.hasAudioStream && taskItem.playingAudio && !taskItem.isSeparator) && !shortcutBadge.active
Behavior on activateProgress {
NumberAnimation { duration: taskItem.animations.speedFactor.current*2*taskItem.animations.duration.large }
NumberAnimation { duration: 2 * taskItem.animations.speedFactor.current * taskItem.animations.duration.large }
}
sourceComponent: Item{
@ -564,7 +564,7 @@ Item{
contrast: 0.1
Behavior on opacity {
NumberAnimation { duration: taskItem.animations.speedFactor.current*taskItem.animations.duration.large }
NumberAnimation { duration: taskItem.animations.speedFactor.current * taskItem.animations.duration.large }
}
}
@ -599,8 +599,8 @@ Item{
height: !root.vertical ? thickness : length
anchors.centerIn: parent
readonly property int length: container.iconSize + root.lengthMargins
readonly property int thickness: container.iconSize + root.thickMargins
readonly property int length: taskItem.container.iconSize + root.lengthMargins
readonly property int thickness: taskItem.container.iconSize + root.thickMargins
readonly property real applyOpacity: root.dropNewLauncher && !mouseHandler.onlyLaunchers
&& (root.dragSource == null) && (mouseHandler.hoveredItem === taskItem) ? 0.7 : 0
@ -661,7 +661,7 @@ Item{
Transition{
id: isDraggedTransition
to: "isDragged"
property int speed: taskItem.animations.speedFactor.current*taskItem.animations.duration.large
property int speed: taskItem.animations.speedFactor.current * taskItem.animations.duration.large
SequentialAnimation{
ScriptAction{
@ -730,7 +730,7 @@ Item{
id: defaultTransition
from: "isDragged"
to: "*"
property int speed: taskItem.animations.speedFactor.current*taskItem.animations.duration.large
property int speed: taskItem.animations.speedFactor.current * taskItem.animations.duration.large
SequentialAnimation{
ScriptAction{
@ -787,7 +787,7 @@ Item{
if(!running){
var halfZoom = 1 + ((root.zoomFactor - 1) / 2);
wrapper.calculateScales((container.iconSize+root.thickMargins)/2);
wrapper.calculateScales((taskItem.container.iconSize+root.thickMargins)/2);
taskItem.animationEnded();
// root.animations--;

@ -63,7 +63,7 @@ Item {
if (showsAudioBadge) {
return height;
} else if ( index === parabolicManager.firstRealTaskIndex && !taskItem.containsMouse) {
return (wrapper.mScale * (container.iconSize - (root.enableShadows ? shadowSize/2 : 0)));
return (wrapper.mScale * (taskItem.container.iconSize - (root.enableShadows ? shadowSize/2 : 0)));
} else {
return 999999;
}

@ -59,13 +59,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: container.iconSize < 48
property bool centerInParent: taskItem.container.iconSize < 48
anchors.left: centerInParent? undefined : parent.left
anchors.top: centerInParent? undefined : parent.top
anchors.centerIn: centerInParent? parent : undefined
minimumWidth: 0.4 * (wrapper.mScale * container.iconSize)
height: Math.max(24, 0.4 * (wrapper.mScale * container.iconSize))
minimumWidth: 0.4 * (wrapper.mScale * taskItem.container.iconSize)
height: Math.max(24, 0.4 * (wrapper.mScale * taskItem.container.iconSize))
style3d: root.badges3DStyle
textValue: shorcutBadge.badgeString

@ -53,7 +53,7 @@ MouseArea{
if (isSeparator) {
if (root.vertical) {
return container.iconSize + root.thickMargins + root.screenEdgeMargin;
return taskItem.container.iconSize + root.thickMargins + root.screenEdgeMargin;
} else {
if (root.dragSource || !root.parabolicEffectEnabled) {
return LatteCore.Environment.separatorLength+2*root.lengthExtMargin;
@ -80,7 +80,7 @@ MouseArea{
if (isSeparator) {
if (!root.vertical) {
return container.iconSize + root.thickMargins + root.screenEdgeMargin;
return taskItem.container.iconSize + root.thickMargins + root.screenEdgeMargin;
} else {
if (root.dragSource || !root.parabolicEffectEnabled) {
return LatteCore.Environment.separatorLength+2*root.lengthExtMargin;
@ -138,14 +138,14 @@ MouseArea{
property bool isWindow: (IsWindow === true) ? true : false
property bool isZoomed: false
property bool canPublishGeometries: (isWindow || isStartup || isGroupParent) && visible && width>=container.iconSize && height>=container.iconSize
property bool canPublishGeometries: (isWindow || isStartup || isGroupParent) && visible && width>=taskItem.container.iconSize && height>=taskItem.container.iconSize
&& !taskItem.delayingRemove
&& (wrapper.mScale===1 || wrapper.mScale===root.zoomFactor) //don't publish during zoomFactor
property bool pressed: false
property bool wheelIsBlocked: false
property int animationTime: (animations.active ? animations.speedFactor.current : 2) * (1.2 *animations.duration.small)
property int animationTime: (taskItem.animations.active ? taskItem.animations.speedFactor.current : 2) * (1.2 *taskItem.animations.duration.small)
property int badgeIndicator: 0 //it is used from external apps
property int hoveredIndex: icList.hoveredIndex
property int itemIndex: index
@ -154,7 +154,7 @@ MouseArea{
property int pressX: -1
property int pressY: -1
property int resistanceDelay: 450
property int spacersMaxSize: Math.max(0,Math.ceil(0.55*container.iconSize) - root.lengthMargins)
property int spacersMaxSize: Math.max(0,Math.ceil(0.55*taskItem.container.iconSize) - root.lengthMargins)
property int windowsCount: subWindows.windowsCount
property int windowsMinimizedCount: subWindows.windowsMinimized
@ -180,6 +180,7 @@ MouseArea{
//abilities
property Item animations: null
property Item container: null
onModelLauncherUrlChanged: {
if (modelLauncherUrl !== ""){
@ -249,7 +250,7 @@ MouseArea{
Behavior on opacity {
// NumberAnimation { duration: (IsStartup || (IsLauncher) ) ? 0 : 400 }
NumberAnimation { duration: animations.speedFactor.current*animations.duration.large }
NumberAnimation { duration: taskItem.animations.speedFactor.current * taskItem.animations.duration.large }
}
Loader{
@ -311,7 +312,7 @@ MouseArea{
property real opacityN: isSeparator && root.contextMenu && root.contextMenu.visualParent === taskItem ? 1 : 0
Behavior on opacityN {
NumberAnimation { duration: animations.speedFactor.current*animations.duration.large }
NumberAnimation { duration: taskItem.animations.speedFactor.current * taskItem.animations.duration.large }
}
sourceComponent: Rectangle{
@ -348,13 +349,13 @@ MouseArea{
opacity: (separatorShadow.active) || forceHiddenState ? 0 : 0.4
visible: taskItem.isSeparator
width: root.vertical ? container.iconSize : ((root.dragSource || root.editMode) ? LatteCore.Environment.separatorLength+root.lengthMargins: 1)
height: !root.vertical ? container.iconSize : ((root.dragSource || root.editMode) ? LatteCore.Environment.separatorLength+root.lengthMargins: 1)
width: root.vertical ? taskItem.container.iconSize : ((root.dragSource || root.editMode) ? LatteCore.Environment.separatorLength+root.lengthMargins: 1)
height: !root.vertical ? taskItem.container.iconSize : ((root.dragSource || root.editMode) ? LatteCore.Environment.separatorLength+root.lengthMargins: 1)
property bool forceHiddenState: false
Behavior on opacity {
NumberAnimation { duration: animations.speedFactor.current*animations.duration.large }
NumberAnimation { duration: taskItem.animations.speedFactor.current * taskItem.animations.duration.large }
}
function updateForceHiddenState() {
@ -425,8 +426,8 @@ MouseArea{
Rectangle {
anchors.centerIn: parent
width: root.vertical ? container.iconSize - 4 : 1
height: !root.vertical ? container.iconSize - 4 : 1
width: root.vertical ? taskItem.container.iconSize - 4 : 1
height: !root.vertical ? taskItem.container.iconSize - 4 : 1
color: enforceLattePalette ? latteBridge.palette.textColor : theme.textColor
}
@ -441,7 +442,7 @@ MouseArea{
opacity: separatorItem.forceHiddenState ? 0 : 0.4
Behavior on opacity {
NumberAnimation { duration: animations.speedFactor.current*animations.duration.large }
NumberAnimation { duration: taskItem.animations.speedFactor.current * taskItem.animations.duration.large }
}
sourceComponent: DropShadow{
@ -734,7 +735,7 @@ MouseArea{
|| root.globalDirectRender || !scalesUpdatedOnce) {
if(root.dragSource == null){
var step = Math.abs(icList.currentSpot-mousePos);
if (step >= animations.hoverPixelSensitivity){
if (step >= taskItem.animations.hoverPixelSensitivity){
icList.currentSpot = mousePos;
wrapper.calculateScales(mousePos);
@ -902,7 +903,7 @@ MouseArea{
pressed = false;
if(!inAnimation) {
startCheckRestoreZoomTimer(3*animations.duration.large);
startCheckRestoreZoomTimer(3 * taskItem.animations.duration.large);
}
}
@ -1309,7 +1310,7 @@ MouseArea{
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 = container.iconSize * wrapper.mScale;
var length = taskItem.container.iconSize * wrapper.mScale;
var thickness = length;
//! Magic Lamp effect doesn't like coordinates outside the screen and
@ -1659,8 +1660,8 @@ MouseArea{
//launchers delay A LOT to reappear, e.g google-chrome
//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*animations.speedFactor.current*showWindowAnimation.speed
property int windowDelay: taskItem.isStartup ? 3*animations.speedFactor.current*animations.duration.large : mainDelay
property int mainDelay: (AppId == "google-chrome") ? 0 : 2 * taskItem.animations.speedFactor.current * showWindowAnimation.speed
property int windowDelay: taskItem.isStartup ? 3 * taskItem.animations.speedFactor.current * taskItem.animations.duration.large : mainDelay
Component {
id: delayShowWindow

@ -36,7 +36,7 @@ Item{
if (!root.vertical)
return 0;
else
return (container.iconSize + root.widthMargins + root.screenEdgeMargin);
return (taskItem.container.iconSize + root.widthMargins + root.screenEdgeMargin);
}
if (taskItem.isStartup && taskItem.animations.speedFactor.current !==0 ) {
@ -54,7 +54,7 @@ Item{
if (root.vertical)
return 0;
else
return (container.iconSize + root.heightMargins + root.screenEdgeMargin);
return (taskItem.container.iconSize + root.heightMargins + root.screenEdgeMargin);
}
if (taskItem.isStartup && taskItem.animations.speedFactor.current !==0){
@ -64,8 +64,8 @@ Item{
}
}
property int maxThickness: !root.vertical ? root.zoomFactor*(container.iconSize+root.heightMargins)
: root.zoomFactor*(container.iconSize+root.widthMargins)
property int maxThickness: !root.vertical ? root.zoomFactor*(taskItem.container.iconSize+root.heightMargins)
: root.zoomFactor*(taskItem.container.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: (container.iconSize + root.widthMargins) * mScale
property real cleanScalingHeight: (container.iconSize + root.heightMargins) * mScale
property real cleanScalingWidth: (taskItem.container.iconSize + root.widthMargins) * mScale
property real cleanScalingHeight: (taskItem.container.iconSize + root.heightMargins) * mScale
property real basicScalingWidth : (inTempScaling == true) ? ((container.iconSize + root.widthMargins) * scaleWidth) : cleanScalingWidth
property real basicScalingHeight : (inTempScaling == true) ? ((container.iconSize + root.heightMargins) * scaleHeight) : cleanScalingHeight
property real basicScalingWidth : (inTempScaling == true) ? ((taskItem.container.iconSize + root.widthMargins) * scaleWidth) : cleanScalingWidth
property real basicScalingHeight : (inTempScaling == true) ? ((taskItem.container.iconSize + root.heightMargins) * scaleHeight) : cleanScalingHeight
property real regulatorWidth: taskItem.isSeparator ? width : basicScalingWidth;
property real regulatorHeight: taskItem.isSeparator ? height : basicScalingHeight;
property real visualScaledWidth: (container.iconSize + root.internalWidthMargins) * mScale
property real visualScaledHeight: (container.iconSize + root.internalHeightMargins) * mScale
property real visualScaledWidth: (taskItem.container.iconSize + root.internalWidthMargins) * mScale
property real visualScaledHeight: (taskItem.container.iconSize + root.internalHeightMargins) * mScale
/// end of Scalers///////
//property int curIndex: icList.hoveredIndex

@ -27,7 +27,7 @@ SequentialAnimation{
id: clickedAnimation
property bool pressed: taskItem.pressed
property int speed: taskItem.animations.speedFactor.current*taskItem.animations.duration.large
property int speed: taskItem.animations.speedFactor.current * taskItem.animations.duration.large
property real maxMScale: Math.max(1,root.zoomFactor - (root.zoomFactor - 1) / 2)
ParallelAnimation{
@ -77,7 +77,7 @@ SequentialAnimation{
if( !taskItem.isDragged){
//taskItem.animationEnded();
if(!root.latteView)
checkListHovered.startDuration(6*taskItem.animations.duration.large);
checkListHovered.startDuration(6 * taskItem.animations.duration.large);
}
}
}

@ -28,7 +28,7 @@ SequentialAnimation{
id:launcherAnimation
property bool launchedAlready: false
property int speed: taskItem.animations.speedFactor.current * 0.9 * taskItem.animations.duration.large
property int speed: 0.9 * taskItem.animations.speedFactor.current * taskItem.animations.duration.large
readonly property string needThicknessEvent: launcherAnimation + "_launcher"

@ -28,7 +28,7 @@ import org.kde.plasma.core 2.0 as PlasmaCore
SequentialAnimation{
id:newWindowAnimation
property int speed: taskItem.animations.speedFactor.normal*1.2*taskItem.animations.duration.large
property int speed: 1.2 * taskItem.animations.speedFactor.normal * taskItem.animations.duration.large
property bool isDemandingAttention: taskItem.inAttention
property bool containsMouse: taskItem.containsMouse

@ -112,7 +112,7 @@ SequentialAnimation {
duration: taskItem.inBouncingAnimation && !taskItem.isSeparator? 4*launcherSpeedStep + 50 : 0
easing.type: Easing.InQuad
property int launcherSpeedStep: taskItem.animations.speedFactor.current * 0.8 * taskItem.animations.duration.large
property int launcherSpeedStep: 0.8 * taskItem.animations.speedFactor.current * taskItem.animations.duration.large
}
//end of ghost animation

@ -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.animations.speedFactor.normal * taskItem.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 + container.iconSize;
componentRemoveAnimation.toPoint = tempPoint + taskItem.container.iconSize;
}
else{
componentRemoveAnimation.toPoint = tempPoint - container.iconSize;
componentRemoveAnimation.toPoint = tempPoint - taskItem.container.iconSize;
}
visible = true;

@ -27,7 +27,7 @@ import org.kde.latte.core 0.2 as LatteCore
///item's added Animation
SequentialAnimation{
id:showWindowAnimation
property int speed: root.animationNewWindowSliding ? taskItem.animations.speedFactor.normal * (1.2*taskItem.animations.duration.large) : 0
property int speed: root.animationNewWindowSliding ? (1.2 * taskItem.animations.speedFactor.normal * taskItem.animations.duration.large) : 0
property bool animationSent: false
readonly property string needLengthEvent: showWindowAnimation + "_showwindow"

@ -59,14 +59,14 @@ Item {
readonly property int windowsCount: taskIsValid ? taskItem.windowsCount : 0
readonly property int windowsMinimizedCount: taskIsValid ? taskItem.windowsMinimizedCount : 0
readonly property int currentIconSize: container.iconSize
readonly property int maxIconSize: container.maxIconSize
readonly property int currentIconSize: taskIsValid ? taskItem.container.iconSize : container.iconSize
readonly property int maxIconSize: taskIsValid ? taskItem.container.maxIconSize : container.iconSize
readonly property real scaleFactor: taskIsValid ? taskItem.wrapperAlias.mScale : 1
readonly property real panelOpacity: root.currentPanelOpacity
readonly property color shadowColor: root.appShadowColorSolid
readonly property bool animationsEnabled: animations.active
readonly property real durationTime: animations.speedFactor.current
readonly property bool animationsEnabled: taskIsValid ? taskItem.animations.active : animations.active
readonly property real durationTime: taskIsValid ? taskItem.animations.speedFactor.current : animations.speedFactor.current
readonly property bool progressVisible: wrapper.progressVisible /*since 0.9.2*/
readonly property real progress: wrapper.progress /*since 0.9.2*/

@ -58,8 +58,10 @@ Loader {
readonly property bool locked: inAttentionAnimation || inNewWindowAnimation || inBouncingAnimation
property real visualLockedWidth: root.vertical ? root.screenEdgeMargin + container.iconSize + root.internalWidthMargins : container.iconSize + root.internalWidthMargins
property real visualLockedHeight: !root.vertical ? root.screenEdgeMargin + container.iconSize + root.internalHeightMargins : container.iconSize + root.internalHeightMargins
property real visualLockedWidth: root.vertical ? root.screenEdgeMargin + taskItem.container.iconSize + root.internalWidthMargins :
taskItem.container.iconSize + root.internalWidthMargins
property real visualLockedHeight: !root.vertical ? root.screenEdgeMargin + taskItem.container.iconSize + root.internalHeightMargins :
taskItem.container.iconSize + root.internalHeightMargins
//! Connections !//

Loading…
Cancel
Save