From fb0415905c70bb176bfe27e466dc5ece3f418024 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sat, 28 Jan 2017 10:46:48 +0200 Subject: [PATCH] improve calculating dock geometry --- containment/contents/ui/VisibilityManager.qml | 25 +++++++++---------- containment/contents/ui/main.qml | 1 - 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/containment/contents/ui/VisibilityManager.qml b/containment/contents/ui/VisibilityManager.qml index 05482368f..ef2cf5a30 100644 --- a/containment/contents/ui/VisibilityManager.qml +++ b/containment/contents/ui/VisibilityManager.qml @@ -261,21 +261,20 @@ Item{ dock.maskArea = newMaskArea; //console.log("update mask area:"+newMaskArea); - if((normalState || plasmoid.userConfiguring) && !dock.visibility.isHidden){ + if(normalState && !dock.visibility.isHidden){ //the shadows size must be removed from the maskArea //before updating the localDockGeometry - if (plasmoid.userConfiguring || (dock.visibility.mode === Latte.Dock.AlwaysVisible) ) { - if (plasmoid.formFactor === PlasmaCore.Types.Vertical) { - newMaskArea.width = newMaskArea.width - editModeVisual.shadowSize; - } else { - newMaskArea.height = newMaskArea.height - editModeVisual.shadowSize; - } - - if (plasmoid.location === PlasmaCore.Types.BottomEdge) { - newMaskArea.y = newMaskArea.y + editModeVisual.shadowSize; - } else if (plasmoid.location === PlasmaCore.Types.RightEdge) { - newMaskArea.x = newMaskArea.x + editModeVisual.shadowSize; - } + + if (plasmoid.formFactor === PlasmaCore.Types.Vertical) { + newMaskArea.width = newMaskArea.width - editModeVisual.shadowSize; + } else { + newMaskArea.height = newMaskArea.height - editModeVisual.shadowSize; + } + + if (plasmoid.location === PlasmaCore.Types.BottomEdge) { + newMaskArea.y = newMaskArea.y + editModeVisual.shadowSize; + } else if (plasmoid.location === PlasmaCore.Types.RightEdge) { + newMaskArea.x = newMaskArea.x + editModeVisual.shadowSize; } dock.setLocalDockGeometry(newMaskArea); diff --git a/containment/contents/ui/main.qml b/containment/contents/ui/main.qml index df2c4bd7c..5e03ab86a 100644 --- a/containment/contents/ui/main.qml +++ b/containment/contents/ui/main.qml @@ -1089,7 +1089,6 @@ DragDrop.DropArea { rows: root.isHorizontal ? 1 : 0 rowSpacing: 0 - Layout.preferredWidth: width Layout.preferredHeight: height