fixes for panel background metrics

v0.6
Michail Vourlakos 8 years ago
parent d1fee96a33
commit 1f33b17c03

@ -33,17 +33,34 @@ import org.kde.latte 0.1 as Latte
Item{ Item{
id:barLine id:barLine
width: root.isHorizontal ? panelWidth : smallSize
height: root.isVertical ? panelHeight : smallSize
opacity: root.useThemePanel ? 1 : 0 opacity: root.useThemePanel ? 1 : 0
property int panelWidth: root.drawShadowsExternal ? root.width : property int panelWidth: {
(root.panelAlignment === Latte.Dock.Justify) && root.isHorizontal && !root.editMode ? if (root.drawShadowsExternal) {
layoutsContainer.contentWidth + spacing : mainLayout.width + spacing return root.width;
property int panelHeight: root.drawShadowsExternal ? root.height : } else {
(root.panelAlignment === Latte.Dock.Justify) && root.isVertical && !root.editMode ? if ((root.panelAlignment === Latte.Dock.Justify) && root.isHorizontal && !root.editMode) {
layoutsContainer.contentHeight + spacing : mainLayout.height + spacing return root.maxLength;
} else {
return mainLayout.width + spacing;
}
}
}
width: root.isHorizontal ? panelWidth : smallSize property int panelHeight: {
height: root.isVertical ? panelHeight : smallSize if (root.drawShadowsExternal) {
return root.height;
} else {
if ((root.panelAlignment === Latte.Dock.Justify) && root.isVertical && !root.editMode) {
return root.maxLength;
} else {
return mainLayout.height + spacing;
}
}
}
property int spacing: (root.panelAlignment === Latte.Dock.Center property int spacing: (root.panelAlignment === Latte.Dock.Center
|| plasmoid.configuration.panelPosition === Latte.Dock.Justify) ? || plasmoid.configuration.panelPosition === Latte.Dock.Justify) ?
@ -82,8 +99,8 @@ Item{
PlasmaCore.FrameSvgItem{ PlasmaCore.FrameSvgItem{
id: shadowsSvgItem id: shadowsSvgItem
width: root.isVertical ? panelSize + marginsWidth : parent.width + marginsWidth width: root.isVertical ? panelSize + marginsWidth : Math.min(parent.width + marginsWidth, root.width - marginsWidth)
height: root.isVertical ? parent.height + marginsHeight : panelSize + marginsHeight height: root.isVertical ? Math.min(parent.height + marginsHeight, root.height - marginsHeight) : panelSize + marginsHeight
imagePath: root.drawShadowsExternal ? "" : "widgets/panel-background" imagePath: root.drawShadowsExternal ? "" : "widgets/panel-background"
prefix: root.drawShadowsExternal ? "" : "shadow" prefix: root.drawShadowsExternal ? "" : "shadow"

@ -1129,7 +1129,7 @@ DragDrop.DropArea {
property int hoveredIndex: -1 property int hoveredIndex: -1
x: { x: {
if ( (plasmoid.configuration.panelPosition === Latte.Dock.Justify) && root.isHorizontal if ( dock && (plasmoid.configuration.panelPosition === Latte.Dock.Justify) && root.isHorizontal
&& !root.editMode && windowSystem.compositingActive && !root.drawShadowsExternal ){ && !root.editMode && windowSystem.compositingActive && !root.drawShadowsExternal ){
return ((dock.width/2) - (root.maxLength/2)) return ((dock.width/2) - (root.maxLength/2))
} else { } else {
@ -1146,7 +1146,7 @@ DragDrop.DropArea {
} }
y: { y: {
if ( (plasmoid.configuration.panelPosition === Latte.Dock.Justify) && root.isVertical if ( dock && (plasmoid.configuration.panelPosition === Latte.Dock.Justify) && root.isVertical
&& !root.editMode && windowSystem.compositingActive && !root.drawShadowsExternal ) { && !root.editMode && windowSystem.compositingActive && !root.drawShadowsExternal ) {
return ((dock.height/2) - (root.maxLength/2)); return ((dock.height/2) - (root.maxLength/2));
} else { } else {

Loading…
Cancel
Save