fix #128, reimplement the panel draw

--this contains also a fix for updating the
struts
v0.6
Michail Vourlakos 8 years ago
parent aafffb421f
commit 65e4558e23

@ -289,6 +289,14 @@ Window{
text: root.panelShadow
}
Text{
text: "Panel Background Margin"+space
}
Text{
text: root.panelMargin
}
Text{
text: " ----------- "
}

@ -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();

@ -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);

@ -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

Loading…
Cancel
Save