1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-25 19:21:41 +03:00

update plasmoid Containment to Container

This commit is contained in:
Michail Vourlakos 2020-04-20 10:55:35 +03:00
parent a72c30f763
commit 505f63b3ad
19 changed files with 75 additions and 75 deletions

View File

@ -19,7 +19,7 @@
import QtQuick 2.7
ContainmentPrivate {
ContainerPrivate {
id: apis
publicApi: Item {

View File

@ -113,7 +113,7 @@ Item{
readonly property QtObject windowsTracker: mainCommunicator.windowsTrackingEnabled && latteView && latteView.windowsTracker ?
latteView.windowsTracker : null
readonly property Item containment: container
readonly property Item container: root.container
property Item actions: Actions{}

View File

@ -1825,7 +1825,7 @@ Item {
///////////////BEGIN ABILITIES
Ability.Containment{
Ability.Container{
id: _container
}

View File

@ -122,7 +122,7 @@ function insertIndexAt(above, x, y) {
} else {
var distance = root.vertical ? y : x;
//var step = root.vertical ? LayoutManager.taskWidth() : LayoutManager.taskHeight();
var step = containment.iconSize + root.lengthMargins;
var step = container.iconSize + root.lengthMargins;
var stripe = Math.ceil(distance / step);
/* if (stripe === LayoutManager.calculateStripes()) {

View File

@ -20,8 +20,8 @@
import QtQuick 2.7
Item {
readonly property int iconSize: latteBridge ? latteBridge.containment.iconSize : localIconSize
readonly property int maxIconSize: latteBridge ? latteBridge.containment.maxIconSize : iconSize
readonly property int iconSize: latteBridge ? latteBridge.container.iconSize : localIconSize
readonly property int maxIconSize: latteBridge ? latteBridge.container.maxIconSize : iconSize
property int localIconSize: 48

View File

@ -136,7 +136,7 @@ Item {
property Item dragSource: null
property Item parabolicManager: _parabolicManager
property Item tasksExtendedManager: _tasksExtendedManager
readonly property Item containment: _containment
readonly property Item container: _container
readonly property alias containsDrag: mouseHandler.containsDrag
readonly property bool dragAreaEnabled: latteView ? (root.dragSource !== null
@ -215,10 +215,10 @@ Item {
}
}
property int thickMargin: latteView ? latteView.thickMargin : 0.16*containment.iconSize
property int thickMargin: latteView ? latteView.thickMargin : 0.16*container.iconSize
property int thickMargins: 2 * thickMargin
property int lengthIntMargin: latteView ? latteView.lengthIntMargin : 0.04 * containment.iconSize
property int lengthExtMargin: latteView ? latteView.lengthExtMargin : 0.1 * containment.iconSize
property int lengthIntMargin: latteView ? latteView.lengthIntMargin : 0.04 * container.iconSize
property int lengthExtMargin: latteView ? latteView.lengthExtMargin : 0.1 * container.iconSize
property int lengthMargin: lengthIntMargin + lengthExtMargin
property int lengthMargins: 2 * lengthMargin
@ -249,7 +249,7 @@ Item {
property real durationTime: latteView ? latteView.durationTime : plasmoid.configuration.durationTime
property real zoomFactor: latteView ? latteView.zoomFactor : ( 1 + (plasmoid.configuration.zoomLevel / 20) )
property int appShadowSize: latteView ? latteView.appShadowSize : Math.ceil(0.12*containment.iconSize)
property int appShadowSize: latteView ? latteView.appShadowSize : Math.ceil(0.12*container.iconSize)
property string appShadowColor: latteView ? latteView.appShadowColor : "#ff080808"
property string appShadowColorSolid: latteView ? latteView.appShadowColorSolid : "#ff080808"
@ -967,8 +967,8 @@ Item {
id: _tasksExtendedManager
}
Ability.ContainmentAbility {
id: _containment
Ability.ContainerAbility {
id: _container
localIconSize: Math.max(plasmoid.configuration.iconSize, 16)
}
@ -1056,15 +1056,15 @@ Item {
anchors.horizontalCenter: !root.vertical ? parent.horizontalCenter : undefined
anchors.verticalCenter: root.vertical ? parent.verticalCenter : undefined
width: root.vertical ? 1 : 2 * containment.iconSize
height: root.vertical ? 2 * containment.iconSize : 1
width: root.vertical ? 1 : 2 * container.iconSize
height: root.vertical ? 2 * container.iconSize : 1
color: "red"
x: (root.location === PlasmaCore.Types.LeftEdge) ? neededSpace : parent.width - neededSpace
y: (root.location === PlasmaCore.Types.TopEdge) ? neededSpace : parent.height - neededSpace
visible: plasmoid.configuration.zoomHelper
property int neededSpace: zoomFactor*(containment.iconSize+lengthMargins)
property int neededSpace: zoomFactor*(container.iconSize+lengthMargins)
}
Item{
@ -1080,8 +1080,8 @@ Item {
width: ( icList.orientation === Qt.Horizontal ) ? icList.width + spacing : smallSize
height: ( icList.orientation === Qt.Vertical ) ? icList.height + spacing : smallSize
property int spacing: latteView ? 0 : containment.iconSize / 2
property int smallSize: Math.max(0.10 * containment.iconSize, 16)
property int spacing: latteView ? 0 : container.iconSize / 2
property int smallSize: Math.max(0.10 * container.iconSize, 16)
Behavior on opacity{
NumberAnimation { duration: root.durationTime*root.longDuration }
@ -1178,8 +1178,8 @@ Item {
visible: root.dragAreaEnabled
property int maxSize: (((root.hoveredIndex>=0 || dockHoveredIndex>=0 ) || windowPreviewIsShown) && !root.dragSource) ?
root.zoomFactor * (containment.iconSize + root.thickMargins) + root.screenEdgeMargin :
containment.iconSize + root.thickMargins + root.screenEdgeMargin
root.zoomFactor * (container.iconSize + root.thickMargins) + root.screenEdgeMargin :
container.iconSize + root.thickMargins + root.screenEdgeMargin
function onlyLaunchersInList(list){
return list.every(function (item) {
@ -1241,7 +1241,7 @@ Item {
return !latteView.thickAnimated ? latteView.maskManager.thicknessNormal : latteView.maskManager.thicknessZoom;
}
return (root.thickMargins + containment.iconSize) * root.zoomFactor;
return (root.thickMargins + container.iconSize) * root.zoomFactor;
}
//onCurrentPosChanged: console.log("CP :: "+ currentPos + " icW:"+icList.width + " rw: "+root.width + " w:" +width);
@ -1362,7 +1362,7 @@ Item {
id: newDroppedLauncherVisual
anchors.fill: parent
visible: backgroundOpacity > 0
radius: containment.iconSize/10
radius: container.iconSize/10
backgroundOpacity: root.dropNewLauncher && mouseHandler.onlyLaunchers && (root.dragSource == null)? 0.75 : 0
duration: root.durationTime

View File

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

View File

@ -119,12 +119,12 @@ Item{
TitleTooltipParent{
id: titleTooltipParent
thickness: root.zoomFactor * (containment.iconSize + root.thickMargins)
thickness: root.zoomFactor * (container.iconSize + root.thickMargins)
}
TitleTooltipParent{
id: previewsTooltipParent
thickness: root.zoomFactor * (containment.iconSize + root.thickMargins) + 1
thickness: root.zoomFactor * (container.iconSize + root.thickMargins) + 1
}
//!
@ -186,12 +186,12 @@ Item{
}
}
property int zoomedSize: root.zoomFactor * containment.iconSize
property int zoomedSize: root.zoomFactor * container.iconSize
property real basicScalingWidth : wrapper.inTempScaling ? (containment.iconSize * wrapper.scaleWidth) :
containment.iconSize * wrapper.mScale
property real basicScalingHeight : wrapper.inTempScaling ? (containment.iconSize * wrapper.scaleHeight) :
containment.iconSize * wrapper.mScale
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 newTempSize: {
if (wrapper.opacity === 1 ) {
@ -600,8 +600,8 @@ Item{
height: !root.vertical ? thickness : length
anchors.centerIn: parent
readonly property int length: containment.iconSize + root.lengthMargins
readonly property int thickness: containment.iconSize + root.thickMargins
readonly property int length: container.iconSize + root.lengthMargins
readonly property int thickness: container.iconSize + root.thickMargins
readonly property real applyOpacity: root.dropNewLauncher && !mouseHandler.onlyLaunchers
&& (root.dragSource == null) && (mouseHandler.hoveredItem === taskItem) ? 0.7 : 0
@ -788,7 +788,7 @@ Item{
if(!running){
var halfZoom = 1 + ((root.zoomFactor - 1) / 2);
wrapper.calculateScales((containment.iconSize+root.thickMargins)/2);
wrapper.calculateScales((container.iconSize+root.thickMargins)/2);
taskItem.animationEnded();
// root.animations--;

View File

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

View File

@ -60,13 +60,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: containment.iconSize < 48
property bool centerInParent: 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 * containment.iconSize)
height: Math.max(24, 0.4 * (wrapper.mScale * containment.iconSize))
minimumWidth: 0.4 * (wrapper.mScale * container.iconSize)
height: Math.max(24, 0.4 * (wrapper.mScale * container.iconSize))
style3d: root.badges3DStyle
textValue: shorcutBadge.badgeString

View File

@ -52,7 +52,7 @@ MouseArea{
if (isSeparator) {
if (root.vertical) {
return containment.iconSize + root.thickMargins + root.screenEdgeMargin;
return container.iconSize + root.thickMargins + root.screenEdgeMargin;
} else {
if (root.dragSource || !root.parabolicEffectEnabled) {
return LatteCore.Environment.separatorLength+2*root.lengthExtMargin;
@ -79,7 +79,7 @@ MouseArea{
if (isSeparator) {
if (!root.vertical) {
return containment.iconSize + root.thickMargins + root.screenEdgeMargin;
return container.iconSize + root.thickMargins + root.screenEdgeMargin;
} else {
if (root.dragSource || !root.parabolicEffectEnabled) {
return LatteCore.Environment.separatorLength+2*root.lengthExtMargin;
@ -137,7 +137,7 @@ MouseArea{
property bool isWindow: (IsWindow === true) ? true : false
property bool isZoomed: false
property bool canPublishGeometries: (isWindow || isStartup || isGroupParent) && visible && width>=containment.iconSize && height>=containment.iconSize
property bool canPublishGeometries: (isWindow || isStartup || isGroupParent) && visible && width>=container.iconSize && height>=container.iconSize
&& !taskItem.delayingRemove
&& (wrapper.mScale===1 || wrapper.mScale===root.zoomFactor) //don't publish during zoomFactor
@ -153,7 +153,7 @@ MouseArea{
property int pressX: -1
property int pressY: -1
property int resistanceDelay: 450
property int spacersMaxSize: Math.max(0,Math.ceil(0.55*containment.iconSize) - root.lengthMargins)
property int spacersMaxSize: Math.max(0,Math.ceil(0.55*container.iconSize) - root.lengthMargins)
property int windowsCount: subWindows.windowsCount
property int windowsMinimizedCount: subWindows.windowsMinimized
@ -344,8 +344,8 @@ MouseArea{
opacity: (separatorShadow.active) || forceHiddenState ? 0 : 0.4
visible: taskItem.isSeparator
width: root.vertical ? containment.iconSize : ((root.dragSource || root.editMode) ? LatteCore.Environment.separatorLength+root.lengthMargins: 1)
height: !root.vertical ? containment.iconSize : ((root.dragSource || root.editMode) ? LatteCore.Environment.separatorLength+root.lengthMargins: 1)
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)
property bool forceHiddenState: false
@ -421,8 +421,8 @@ MouseArea{
Rectangle {
anchors.centerIn: parent
width: root.vertical ? containment.iconSize - 4 : 1
height: !root.vertical ? containment.iconSize - 4 : 1
width: root.vertical ? container.iconSize - 4 : 1
height: !root.vertical ? container.iconSize - 4 : 1
color: enforceLattePalette ? latteBridge.palette.textColor : theme.textColor
}
@ -1305,7 +1305,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 = containment.iconSize * wrapper.mScale;
var length = container.iconSize * wrapper.mScale;
var thickness = length;
//! Magic Lamp effect doesn't like coordinates outside the screen and

View File

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

View File

@ -150,10 +150,10 @@ Item{
if( (root.location === PlasmaCore.Types.BottomEdge) ||
(root.location === PlasmaCore.Types.RightEdge) ){
componentRemoveAnimation.toPoint = tempPoint + containment.iconSize;
componentRemoveAnimation.toPoint = tempPoint + container.iconSize;
}
else{
componentRemoveAnimation.toPoint = tempPoint - containment.iconSize;
componentRemoveAnimation.toPoint = tempPoint - container.iconSize;
}
visible = true;

View File

@ -61,8 +61,8 @@ Item {
readonly property int windowsCount: taskIsValid ? taskItem.windowsCount : 0
readonly property int windowsMinimizedCount: taskIsValid ? taskItem.windowsMinimizedCount : 0
readonly property int currentIconSize: containment.iconSize
readonly property int maxIconSize: containment.maxIconSize
readonly property int currentIconSize: container.iconSize
readonly property int maxIconSize: container.maxIconSize
readonly property real scaleFactor: taskIsValid ? taskItem.wrapperAlias.mScale : 1
readonly property real panelOpacity: root.currentPanelOpacity
readonly property color shadowColor: root.appShadowColorSolid

View File

@ -60,8 +60,8 @@ Loader {
readonly property bool locked: inAttentionAnimation || inNewWindowAnimation || inBouncingAnimation
property real visualLockedWidth: root.vertical ? root.screenEdgeMargin + containment.iconSize + root.internalWidthMargins : containment.iconSize + root.internalWidthMargins
property real visualLockedHeight: !root.vertical ? root.screenEdgeMargin + containment.iconSize + root.internalHeightMargins : containment.iconSize + root.internalHeightMargins
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
//! Connections !//

View File

@ -26,8 +26,8 @@ Item {
id: shadowsContainer
opacity: 0.4
readonly property int gradientLength: containment.iconSize / 3
readonly property int thickness: latteView ? latteView.realPanelSize : containment.iconSize + root.thickMargins
readonly property int gradientLength: container.iconSize / 3
readonly property int thickness: latteView ? latteView.realPanelSize : container.iconSize + root.thickMargins
readonly property color appliedColor: root.appShadowColorSolid
property Item flickable

View File

@ -24,7 +24,7 @@ import org.kde.plasma.core 2.0 as PlasmaCore
Item {
readonly property int gradientLength: containment.iconSize / 3
readonly property int gradientLength: container.iconSize / 3
LinearGradient {
id: firstGradient

View File

@ -56,10 +56,10 @@ Flickable{
readonly property int scrollFirstPos: 0
readonly property int scrollLastPos: contentsExtraSpace
readonly property int scrollStep: containment.iconSize * 1.5
readonly property int scrollStep: container.iconSize * 1.5
readonly property int currentPos: !root.vertical ? contentX : contentY
readonly property int autoScrollTriggerLength: containment.iconSize + root.lengthMargins/2
readonly property int autoScrollTriggerLength: container.iconSize + root.lengthMargins/2
readonly property int alignment: {
if (root.location === PlasmaCore.Types.LeftEdge) {
@ -140,18 +140,18 @@ Flickable{
if (!root.vertical) {
if (cP.x < 0) {
distance = Math.abs(cP.x - containment.iconSize);
distance = Math.abs(cP.x - container.iconSize);
decreasePosWithStep(distance);
} else if ((cP.x+task.width) > scrollableList.width) {
distance = Math.abs(cP.x - scrollableList.width + task.width + containment.iconSize);
distance = Math.abs(cP.x - scrollableList.width + task.width + container.iconSize);
increasePosWithStep(distance);
}
} else {
if (cP.y < 0) {
distance = Math.abs(cP.y - containment.iconSize);
distance = Math.abs(cP.y - container.iconSize);
decreasePosWithStep(distance);
} else if ((cP.y+task.height) > scrollableList.height) {
distance = Math.abs(cP.y - scrollableList.height + task.height + containment.iconSize);
distance = Math.abs(cP.y - scrollableList.height + task.height + container.iconSize);
increasePosWithStep(distance);
}
}
@ -176,15 +176,15 @@ Flickable{
if (!root.vertical) {
if (currentPos !== scrollFirstPos && cP.x < autoScrollTriggerLength) {
decreasePosWithStep(containment.iconSize*1.5);
decreasePosWithStep(container.iconSize*1.5);
} else if (currentPos !== scrollLastPos && (cP.x+task.width > (scrollableList.width-autoScrollTriggerLength))) {
increasePosWithStep(containment.iconSize*1.5);
increasePosWithStep(container.iconSize*1.5);
}
} else {
if (currentPos !== scrollFirstPos && cP.y < autoScrollTriggerLength) {
decreasePosWithStep(containment.iconSize*1.5);
decreasePosWithStep(container.iconSize*1.5);
} else if (currentPos !== scrollLastPos && (cP.y+task.height > (scrollableList.height-autoScrollTriggerLength))) {
increasePosWithStep(containment.iconSize*1.5);
increasePosWithStep(container.iconSize*1.5);
}
}