fix #194,the user can enable a solid background

--this is especial useful for plasma themes with big
transparency. Latte can not support blur and background
contrast kwin effects for panel backgrounds that are drawn
inside its qml side.
v0.6
Michail Vourlakos 8 years ago
parent 93715727d0
commit 0e8691878c

@ -245,7 +245,7 @@ QRegion DockCorona::availableScreenRegion(int id) const
case Latte::Dock::Center: case Latte::Dock::Center:
case Latte::Dock::Justify: case Latte::Dock::Justify:
realGeometry = QRect(view->geometry().center().x() - realWidth / 2 , view->y(), realGeometry = QRect(qMax(view->geometry().x(), view->geometry().center().x() - realWidth / 2) , view->y(),
realWidth , realThickness); realWidth , realThickness);
break; break;
@ -295,9 +295,11 @@ QRegion DockCorona::availableScreenRegion(int id) const
} }
/*qDebug() << "::::: FREE AREAS :::::"; /*qDebug() << "::::: FREE AREAS :::::";
for (int i = 0; i < available.rectCount(); ++i) { for (int i = 0; i < available.rectCount(); ++i) {
qDebug() << available.rects().at(i); qDebug() << available.rects().at(i);
} }
qDebug() << "::::: END OF FREE AREAS :::::";*/ qDebug() << "::::: END OF FREE AREAS :::::";*/
return available; return available;

@ -34,6 +34,9 @@
<entry name="panelSize" type="Int"> <entry name="panelSize" type="Int">
<default>58</default> <default>58</default>
</entry> </entry>
<entry name="solidPanel" type="Bool">
<default>false</default>
</entry>
<entry name="automaticIconSize" type="Bool"> <entry name="automaticIconSize" type="Bool">
<default>false</default> <default>false</default>
</entry> </entry>

@ -57,7 +57,7 @@ Item{
if ((root.panelAlignment === Latte.Dock.Justify) && root.isVertical && !root.editMode) { if ((root.panelAlignment === Latte.Dock.Justify) && root.isVertical && !root.editMode) {
return root.maxLength; return root.maxLength;
} else { } else {
return mainLayout.height + spacing; return mainLayout.height + spacing;
} }
} }
} }
@ -99,8 +99,10 @@ Item{
PlasmaCore.FrameSvgItem{ PlasmaCore.FrameSvgItem{
id: shadowsSvgItem id: shadowsSvgItem
width: root.isVertical ? panelSize + marginsWidth : Math.min(parent.width + marginsWidth, root.width - marginsWidth) width: root.isVertical ? panelSize + marginsWidth - (solidBackground.leftIncreaser + solidBackground.rightIncreaser) :
height: root.isVertical ? Math.min(parent.height + marginsHeight, root.height - marginsHeight) : panelSize + marginsHeight Math.min(parent.width + marginsWidth, root.width - marginsWidth)
height: root.isVertical ? Math.min(parent.height + marginsHeight, root.height - marginsHeight) :
panelSize + marginsHeight - (solidBackground.topIncreaser + solidBackground.bottomIncreaser)
imagePath: root.drawShadowsExternal ? "" : "widgets/panel-background" imagePath: root.drawShadowsExternal ? "" : "widgets/panel-background"
prefix: root.drawShadowsExternal ? "" : "shadow" prefix: root.drawShadowsExternal ? "" : "shadow"
@ -114,12 +116,12 @@ Item{
if (root.drawShadowsExternal) { if (root.drawShadowsExternal) {
return 0; return 0;
} else { } else {
if (root.panelAlignment === Latte.Dock.Left) if (root.panelAlignment === Latte.Dock.Left)
return margins.right; return margins.right;
else if (root.panelAlignment === Latte.Dock.Right) else if (root.panelAlignment === Latte.Dock.Right)
return margins.left; return margins.left;
else else
return margins.left+margins.right; return margins.left+margins.right;
} }
} }
@ -128,11 +130,11 @@ Item{
return 0; return 0;
} else { } else {
if (root.panelAlignment === Latte.Dock.Top) if (root.panelAlignment === Latte.Dock.Top)
return margins.bottom; return margins.bottom;
else if (root.panelAlignment === Latte.Dock.Bottom) else if (root.panelAlignment === Latte.Dock.Bottom)
return margins.top; return margins.top;
else else
return margins.top + margins.bottom; return margins.top + margins.bottom;
} }
} }
@ -194,13 +196,44 @@ Item{
PlasmaCore.FrameSvgItem{ PlasmaCore.FrameSvgItem{
id: solidBackground id: solidBackground
anchors.leftMargin: shadowsSvgItem.margins.left anchors.leftMargin: shadowsSvgItem.margins.left - leftIncreaser
anchors.rightMargin: shadowsSvgItem.margins.right anchors.rightMargin: shadowsSvgItem.margins.right - rightIncreaser
anchors.topMargin: shadowsSvgItem.margins.top anchors.topMargin: shadowsSvgItem.margins.top - topIncreaser
anchors.bottomMargin: shadowsSvgItem.margins.bottom anchors.bottomMargin: shadowsSvgItem.margins.bottom - bottomIncreaser
anchors.fill:parent anchors.fill:parent
imagePath: "widgets/panel-background" imagePath: root.solidPanel ? "opaque/dialogs/background" : "widgets/panel-background"
//! the increases used when the user forces a solid background and the background
//! must be increased in order to look ok in the corners
property int rightIncreaser: {
if (!(root.solidPanel && root.isVertical && plasmoid.location === PlasmaCore.Types.LeftEdge))
return 0;
else
return hiddenPanelBackground.margins.right;
}
property int leftIncreaser: {
if (!(root.solidPanel && root.isVertical && plasmoid.location === PlasmaCore.Types.RightEdge))
return 0;
else
return hiddenPanelBackground.margins.left;
}
property int topIncreaser: {
if (!(root.solidPanel && root.isVertical && plasmoid.location === PlasmaCore.Types.BottomEdge))
return 0;
else
return hiddenPanelBackground.margins.top;
}
property int bottomIncreaser: {
if (!(root.solidPanel && root.isVertical && plasmoid.location === PlasmaCore.Types.TopEdge))
return 0;
else
return hiddenPanelBackground.margins.bottom;
}
Binding { Binding {
target: root target: root
@ -258,7 +291,12 @@ Item{
prefix = ""; prefix = "";
} }
} }
}
PlasmaCore.FrameSvgItem{
id: hiddenPanelBackground
imagePath: "widgets/panel-background"
visible: false
} }
} }
@ -484,3 +522,4 @@ Item{
//END states //END states
} }

@ -50,7 +50,7 @@ DragDrop.DropArea {
property bool confirmedDragEntered: false property bool confirmedDragEntered: false
property bool drawShadowsExternal: visibilityManager.panelIsBiggerFromIconSize && (zoomFactor === 1.0) property bool drawShadowsExternal: visibilityManager.panelIsBiggerFromIconSize && (zoomFactor === 1.0)
&& (dock.visibility.mode === Latte.Dock.AlwaysVisible) && (dock.visibility.mode === Latte.Dock.AlwaysVisible)
&& (plasmoid.configuration.panelPosition === Latte.Dock.Justify) && (plasmoid.configuration.panelPosition === Latte.Dock.Justify) && !root.solidPanel
property bool editMode: plasmoid.userConfiguring property bool editMode: plasmoid.userConfiguring
property bool immutable: plasmoid.immutable property bool immutable: plasmoid.immutable
@ -61,6 +61,7 @@ DragDrop.DropArea {
: (layoutsContainer.hoveredIndex !== -1) //|| wholeArea.containsMouse : (layoutsContainer.hoveredIndex !== -1) //|| wholeArea.containsMouse
property bool normalState : false property bool normalState : false
property bool onlyAddingStarup: true //is used for the initialization phase in startup where there arent removals, this variable provides a way to grow icon size property bool onlyAddingStarup: true //is used for the initialization phase in startup where there arent removals, this variable provides a way to grow icon size
property bool solidPanel: plasmoid.configuration.solidPanel
//FIXME: possibly this is going to be the default behavior, this user choice //FIXME: possibly this is going to be the default behavior, this user choice
//has been dropped from the Dock Configuration Window //has been dropped from the Dock Configuration Window
//property bool smallAutomaticIconJumps: plasmoid.configuration.smallAutomaticIconJumps //property bool smallAutomaticIconJumps: plasmoid.configuration.smallAutomaticIconJumps

@ -227,14 +227,38 @@ PlasmaComponents.Page {
text: i18n("Background") text: i18n("Background")
} }
PlasmaComponents.CheckBox { GridLayout {
id: showBackground width: parent.width
rowSpacing: 1
columnSpacing: 1
Layout.leftMargin: units.smallSpacing * 2 Layout.leftMargin: units.smallSpacing * 2
text: i18n("Show Panel Background") Layout.rightMargin: units.smallSpacing * 2
checked: plasmoid.configuration.useThemePanel
columns: 2
PlasmaComponents.CheckBox {
id: showBackground
Layout.fillWidth: true
text: i18n("Show Panel Background")
checked: plasmoid.configuration.useThemePanel
onClicked: {
plasmoid.configuration.useThemePanel = checked
}
}
PlasmaComponents.CheckBox {
id: solidBackground
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
onClicked: { text: i18n("Solid Background")
plasmoid.configuration.useThemePanel = checked checked: plasmoid.configuration.solidPanel
enabled: showBackground.checked
onClicked: {
plasmoid.configuration.solidPanel = checked
}
} }
} }

Loading…
Cancel
Save