1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-03-30 14:50:12 +03:00

improve geometries publishing

--remove unneeded properties references
This commit is contained in:
Michail Vourlakos 2019-12-24 17:25:46 +02:00
parent 84d8abed91
commit 2314e7c0c0
3 changed files with 7 additions and 21 deletions

View File

@ -41,9 +41,6 @@ import "animations" as TaskAnimations
Item{
id: taskIcon
width: wrapper.regulatorWidth
height: wrapper.regulatorHeight
//big interval to show shadows only after all the crappy adds and removes of tasks
//have happened
property bool firstDrawed: true

View File

@ -1270,6 +1270,7 @@ MouseArea{
var adjY = Math.min(limits.y+limits.height, Math.max(limits.y, globalChoords.y));
var length = root.iconSize * wrapper.mScale;
var thickness = length;
//! Magic Lamp effect doesn't like coordinates outside the screen and
//! width,heights of zero value... So we now normalize the geometries
@ -1283,10 +1284,9 @@ MouseArea{
//! semi-part out of boundaries
length = Math.max(4, Math.abs(adjY - globalChoords.y));
}
}
globalChoords.width = 1;
globalChoords.height = length;
globalChoords.height = length;
}
} else {
if (adjX !== globalChoords.x) {
if (((globalChoords.x+globalChoords.width) < limits.x) || (globalChoords.x)>(limits.x+limits.width)) {
@ -1296,25 +1296,14 @@ MouseArea{
//! semi-part out of boundaries
length = Math.max(4, Math.abs(adjX - globalChoords.x));
}
}
globalChoords.height = 1;
globalChoords.width = length;
globalChoords.width = length;
}
}
globalChoords.x = adjX;
globalChoords.y = adjY;
if (root.position === PlasmaCore.Types.BottomPositioned) {
globalChoords.y = root.screenGeometry.y+root.screenGeometry.height-1;
} else if (root.position === PlasmaCore.Types.TopPositioned) {
globalChoords.y = root.screenGeometry.y+1;
} else if (root.position === PlasmaCore.Types.LeftPositioned) {
globalChoords.x = root.screenGeometry.x+1;
} else if (root.position === PlasmaCore.Types.RightPositioned) {
globalChoords.x = root.screenGeometry.x+root.screenGeometry.width - 1;
}
tasksModel.requestPublishDelegateGeometry(taskItem.modelIndex(), globalChoords, taskItem);
}
}

View File

@ -146,8 +146,8 @@ Item{
anchors.horizontalCenterOffset: taskItem.iconOffsetX
anchors.verticalCenterOffset: taskItem.iconOffsetY
width: wrapper.width
height:wrapper.height
width: wrapper.regulatorWidth
height:wrapper.regulatorHeight
}
function calculateScales( currentMousePosition ){