1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-26 23:21:37 +03:00

bound published tasks geometries at scrollarea

This commit is contained in:
Michail Vourlakos 2019-04-21 15:38:04 +03:00
parent f572970a95
commit 3f66f09045
2 changed files with 44 additions and 2 deletions

View File

@ -1192,18 +1192,48 @@ MouseArea{
|| (latteView && currentLayout && latteView.universalLayoutManager &&
currentLayout.name === latteView.universalLayoutManager.currentLayoutName))) {
var globalChoords = backend.globalRect(taskItem);
var limits = backend.globalRect(scrollableList);
//! Limit the published geometries boundaries at scrolling area boundaries
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 = root.iconSize * wrapper.mScale;
//! Magic Lamp effect doesn't like coordinates outside the screen and
//! width,heights of zero value... So we now normalize the geometries
//! sent in order to avoid such circumstances
if (root.vertical) {
if (adjY !== globalChoords.y) {
if (((globalChoords.y+globalChoords.height) < limits.y) || (globalChoords.y)>(limits.y+limits.height)) {
//! totally out of boundaries
length = 4;
} else {
//! semi-part out of boundaries
length = Math.max(4, Math.abs(adjY - globalChoords.y));
}
}
globalChoords.width = 1;
globalChoords.height = Math.max(root.iconSize, taskItem.height);
globalChoords.height = length;
} else {
if (adjX !== globalChoords.x) {
if (((globalChoords.x+globalChoords.width) < limits.x) || (globalChoords.x)>(limits.x+limits.width)) {
//! totally out of boundaries
length = 4;
} else {
//! semi-part out of boundaries
length = Math.max(4, Math.abs(adjX - globalChoords.x));
}
}
globalChoords.height = 1;
globalChoords.width = Math.max(root.iconSize, taskItem.width);
globalChoords.width = length;
}
globalChoords.x = adjX;
globalChoords.y = adjY;
if (root.position === PlasmaCore.Types.BottomPositioned) {
globalChoords.y = plasmoid.screenGeometry.y+plasmoid.screenGeometry.height-1;
} else if (root.position === PlasmaCore.Types.TopPositioned) {
@ -1362,6 +1392,15 @@ MouseArea{
}
}
Connections {
target: scrollableList
onAnimationsFinishedChanged: {
if (!scrollableList.animationsFinished) {
taskItem.slotPublishGeometries();
}
}
}
///// End of Helper functions ////

View File

@ -31,6 +31,7 @@ Flickable{
property int offset: 0
readonly property bool animationsFinished: !horizontalAnimation.running && !verticalAnimation.running
readonly property bool centered: userPanelPosition === Latte.Types.Center
readonly property bool reversed: Qt.application.layoutDirection === Qt.RightToLeft
@ -132,6 +133,7 @@ Flickable{
Behavior on contentX {
NumberAnimation {
id: horizontalAnimation
duration: root.durationTime*units.longDuration
easing.type: Easing.OutQuad
}
@ -139,6 +141,7 @@ Flickable{
Behavior on contentY {
NumberAnimation {
id: verticalAnimation
duration: root.durationTime*units.longDuration
easing.type: Easing.OutQuad
}