diff --git a/containment/contents/ui/DebugWindow.qml b/containment/contents/ui/DebugWindow.qml index 9d38c441a..06783811d 100644 --- a/containment/contents/ui/DebugWindow.qml +++ b/containment/contents/ui/DebugWindow.qml @@ -289,6 +289,14 @@ Window{ text: root.panelShadow } + Text{ + text: "Panel Background Margin"+space + } + + Text{ + text: root.panelMargin + } + Text{ text: " ----------- " } diff --git a/containment/contents/ui/PanelBox.qml b/containment/contents/ui/PanelBox.qml index c37161a31..304332f0e 100644 --- a/containment/contents/ui/PanelBox.qml +++ b/containment/contents/ui/PanelBox.qml @@ -98,8 +98,8 @@ Item{ property int panelSize: automaticPanelSize property int automaticPanelSize: root.drawShadowsExternal ? 1.2*plasmoid.configuration.iconSize + 1 - : Math.min(root.themePanelSize + root.panelShadow + 1, - root.statesLineSize + root.iconSize + root.iconMargin + 1) + : Math.min(root.themePanelSize + root.panelShadow, + root.statesLineSize + root.iconSize + root.iconMargin + root.panelMargin) property int shadowsSize: { if (shadowsSvgItem && root.useThemePanel){ @@ -139,6 +139,7 @@ Item{ PlasmaCore.FrameSvgItem{ + id: solidBackground anchors.leftMargin: shadowsSvgItem.margins.left anchors.rightMargin: shadowsSvgItem.margins.right anchors.topMargin: shadowsSvgItem.margins.top @@ -147,6 +148,28 @@ Item{ imagePath: "widgets/panel-background" + Binding { + target: root + property: "panelMargin" + value: { + if (root.useThemePanel){ + if (root.isVertical){ + if (plasmoid.location === PlasmaCore.Types.LeftEdge) + return solidBackground.margins.right; + else if (plasmoid.location === PlasmaCore.Types.RightEdge) + return solidBackground.margins.left; + } else { + if (plasmoid.location === PlasmaCore.Types.BottomEdge) + return solidBackground.margins.top; + else if (plasmoid.location === PlasmaCore.Types.TopEdge) + return solidBackground.margins.bottom; + } + } else { + return 0; + } + } + } + onRepaintNeeded: { if (root.drawShadowsExternal) adjustPrefix(); diff --git a/containment/contents/ui/VisibilityManager.qml b/containment/contents/ui/VisibilityManager.qml index a8c70aed8..4ad784db3 100644 --- a/containment/contents/ui/VisibilityManager.qml +++ b/containment/contents/ui/VisibilityManager.qml @@ -301,22 +301,22 @@ Item{ //the shadows size must be removed from the maskArea //before updating the localDockGeometry - if(panelIsBiggerFromIconSize && !root.drawShadowsExternal) { - var shadow = root.panelShadow; + var fixedThickness = thicknessNormal; - var fixedThickness = thicknessNormal - shadow; + if(panelIsBiggerFromIconSize && !root.drawShadowsExternal) { + fixedThickness = thicknessNormal - root.panelShadow; + } - if (plasmoid.formFactor === PlasmaCore.Types.Vertical) { - newMaskArea.width = fixedThickness; - } else { - newMaskArea.height = fixedThickness; - } + if (plasmoid.formFactor === PlasmaCore.Types.Vertical) { + newMaskArea.width = fixedThickness; + } else { + newMaskArea.height = fixedThickness; + } - if (plasmoid.location === PlasmaCore.Types.BottomEdge) { - newMaskArea.y = dock.height - fixedThickness; - } else if (plasmoid.location === PlasmaCore.Types.RightEdge) { - newMaskArea.x = dock.width - fixedThickness; - } + if (plasmoid.location === PlasmaCore.Types.BottomEdge) { + newMaskArea.y = dock.height - fixedThickness; + } else if (plasmoid.location === PlasmaCore.Types.RightEdge) { + newMaskArea.x = dock.width - fixedThickness; } dock.setLocalDockGeometry(newMaskArea); diff --git a/containment/contents/ui/main.qml b/containment/contents/ui/main.qml index addcb5b51..33d323851 100644 --- a/containment/contents/ui/main.qml +++ b/containment/contents/ui/main.qml @@ -85,6 +85,7 @@ DragDrop.DropArea { property int realPanelSize property int realPanelLength: 0 //this is set by the PanelBox + property int panelMargin: 0 property int panelShadow: 0 //shadowsSize property int editShadow: Math.ceil(iconSize / 5) property int themePanelSize: plasmoid.configuration.panelSize