From 20455dc547e84aca075d2c5b89ceb70e2383093a Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Thu, 5 Jan 2017 14:01:42 +0200 Subject: [PATCH] fix #31,theme shadows used in normal state masking --- containment/contents/ui/PanelBox.qml | 8 +++++++- containment/contents/ui/VisibilityManager.qml | 2 +- containment/contents/ui/main.qml | 7 ++++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/containment/contents/ui/PanelBox.qml b/containment/contents/ui/PanelBox.qml index d355fd668..bed864979 100644 --- a/containment/contents/ui/PanelBox.qml +++ b/containment/contents/ui/PanelBox.qml @@ -104,6 +104,13 @@ Item{ NumberAnimation { duration: 200 } } + Binding { + target: root + property: "shadowsSize" + when: shadowsSvgItem && root.useThemePanel + value: root.isVertical ? shadowsSvgItem.margins.top : shadowsSvgItem.margins.bottom + } + Binding { target: root property: "realPanelSize" @@ -115,7 +122,6 @@ Item{ return shadowsSvgItem.panelSize + space; } - } diff --git a/containment/contents/ui/VisibilityManager.qml b/containment/contents/ui/VisibilityManager.qml index 4a53552bd..7117ad256 100644 --- a/containment/contents/ui/VisibilityManager.qml +++ b/containment/contents/ui/VisibilityManager.qml @@ -128,7 +128,7 @@ Item{ var tempLength = root.isHorizontal ? width : height; var tempThickness = root.isHorizontal ? height : width; - var space = root.panelEdgeSpacing + 10; + var space = root.useThemePanel ? root.panelEdgeSpacing + 2*root.shadowsSize : 2; if (normalState && !root.editMode) { //console.log("entered normal state..."); diff --git a/containment/contents/ui/main.qml b/containment/contents/ui/main.qml index 5ac35b25d..2e7a966bd 100644 --- a/containment/contents/ui/main.qml +++ b/containment/contents/ui/main.qml @@ -74,6 +74,8 @@ DragDrop.DropArea { property int previousAllTasks: -1 //is used to forbit updateAutomaticIconSize when hovering property int realSize: iconSize + iconMargin property int realPanelSize + //this is set by the PanelBox + property int shadowsSize: 0 property int themePanelSize: plasmoid.configuration.panelSize ///FIXME: I can't remember why this is needed, maybe for the anchorings!!! In order for the Double Layout to not mess the anchorings... @@ -88,7 +90,6 @@ DragDrop.DropArea { readonly property string plasmoidName: "org.kde.latte.plasmoid" - property var iconsArray: [16, 22, 32, 48, 64, 96, 128, 256] property var layoutManager: LayoutManager @@ -488,6 +489,10 @@ DragDrop.DropArea { } } + onShadowsSizeChanged: { + visibilityManager.updateMaskArea(); + } + onToolBoxChanged: { if (toolBox) { toolBox.visible = false;