mirror of
https://github.com/KDE/latte-dock.git
synced 2024-12-28 03:21:38 +03:00
bound published tasks geometries at scrollarea
This commit is contained in:
parent
f572970a95
commit
3f66f09045
@ -1192,18 +1192,48 @@ MouseArea{
|
|||||||
|| (latteView && currentLayout && latteView.universalLayoutManager &&
|
|| (latteView && currentLayout && latteView.universalLayoutManager &&
|
||||||
currentLayout.name === latteView.universalLayoutManager.currentLayoutName))) {
|
currentLayout.name === latteView.universalLayoutManager.currentLayoutName))) {
|
||||||
var globalChoords = backend.globalRect(taskItem);
|
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
|
//! Magic Lamp effect doesn't like coordinates outside the screen and
|
||||||
//! width,heights of zero value... So we now normalize the geometries
|
//! width,heights of zero value... So we now normalize the geometries
|
||||||
//! sent in order to avoid such circumstances
|
//! sent in order to avoid such circumstances
|
||||||
if (root.vertical) {
|
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.width = 1;
|
||||||
globalChoords.height = Math.max(root.iconSize, taskItem.height);
|
globalChoords.height = length;
|
||||||
} else {
|
} 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.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) {
|
if (root.position === PlasmaCore.Types.BottomPositioned) {
|
||||||
globalChoords.y = plasmoid.screenGeometry.y+plasmoid.screenGeometry.height-1;
|
globalChoords.y = plasmoid.screenGeometry.y+plasmoid.screenGeometry.height-1;
|
||||||
} else if (root.position === PlasmaCore.Types.TopPositioned) {
|
} 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 ////
|
///// End of Helper functions ////
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@ Flickable{
|
|||||||
|
|
||||||
property int offset: 0
|
property int offset: 0
|
||||||
|
|
||||||
|
readonly property bool animationsFinished: !horizontalAnimation.running && !verticalAnimation.running
|
||||||
readonly property bool centered: userPanelPosition === Latte.Types.Center
|
readonly property bool centered: userPanelPosition === Latte.Types.Center
|
||||||
readonly property bool reversed: Qt.application.layoutDirection === Qt.RightToLeft
|
readonly property bool reversed: Qt.application.layoutDirection === Qt.RightToLeft
|
||||||
|
|
||||||
@ -132,6 +133,7 @@ Flickable{
|
|||||||
|
|
||||||
Behavior on contentX {
|
Behavior on contentX {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
|
id: horizontalAnimation
|
||||||
duration: root.durationTime*units.longDuration
|
duration: root.durationTime*units.longDuration
|
||||||
easing.type: Easing.OutQuad
|
easing.type: Easing.OutQuad
|
||||||
}
|
}
|
||||||
@ -139,6 +141,7 @@ Flickable{
|
|||||||
|
|
||||||
Behavior on contentY {
|
Behavior on contentY {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
|
id: verticalAnimation
|
||||||
duration: root.durationTime*units.longDuration
|
duration: root.durationTime*units.longDuration
|
||||||
easing.type: Easing.OutQuad
|
easing.type: Easing.OutQuad
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user