From 2b63ff710b88073833f83c0920984b0350089e7d Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sat, 12 Aug 2017 16:56:04 +0300 Subject: [PATCH] fix #669,block minimize geometries to screen limits -- Magic Lamp effect doesnt like coordinates outside the screen and width,heights of zero value... So we now normalize the geometries sent in order to avoid such circumstances --- .../package/contents/ui/task/TaskDelegate.qml | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/plasmoid/package/contents/ui/task/TaskDelegate.qml b/plasmoid/package/contents/ui/task/TaskDelegate.qml index 876448974..2391ffe51 100644 --- a/plasmoid/package/contents/ui/task/TaskDelegate.qml +++ b/plasmoid/package/contents/ui/task/TaskDelegate.qml @@ -1052,8 +1052,30 @@ MouseArea{ function slotPublishGeometries() { if ((isWindow || isStartup || isGroupParent) && icList && !icList.delayingRemoval) { - tasksModel.requestPublishDelegateGeometry(mainItemContainer.modelIndex(), - backend.globalRect(mainItemContainer), mainItemContainer); + var globalChoords = backend.globalRect(mainItemContainer); + + //! Magic Lamp effect doesnt 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) { + globalChoords.width = 1; + globalChoords.height = Math.max(root.iconSize, mainItemContainer.height); + } else { + globalChoords.height = 1; + globalChoords.width = Math.max(root.iconSize, mainItemContainer.width); + } + + if (root.position === PlasmaCore.Types.BottomPositioned) { + globalChoords.y = plasmoid.screenGeometry.y+plasmoid.screenGeometry.height-1; + } else if (root.position === PlasmaCore.Types.TopPositioned) { + globalChoords.y = plasmoid.screenGeometry.y+1; + } else if (root.position === PlasmaCore.Types.LeftPositioned) { + globalChoords.x = plasmoid.screenGeometry.x+1; + } else if (root.position === PlasmaCore.Types.RightPositioned) { + globalChoords.x = plasmoid.screenGeometry.x+plasmoid.screenGeometry.width - 1; + } + + tasksModel.requestPublishDelegateGeometry(mainItemContainer.modelIndex(), globalChoords, mainItemContainer); } }