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>

@ -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"
@ -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,9 +227,18 @@ PlasmaComponents.Page {
text: i18n("Background") text: i18n("Background")
} }
GridLayout {
width: parent.width
rowSpacing: 1
columnSpacing: 1
Layout.leftMargin: units.smallSpacing * 2
Layout.rightMargin: units.smallSpacing * 2
columns: 2
PlasmaComponents.CheckBox { PlasmaComponents.CheckBox {
id: showBackground id: showBackground
Layout.leftMargin: units.smallSpacing * 2 Layout.fillWidth: true
text: i18n("Show Panel Background") text: i18n("Show Panel Background")
checked: plasmoid.configuration.useThemePanel checked: plasmoid.configuration.useThemePanel
@ -238,6 +247,21 @@ PlasmaComponents.Page {
} }
} }
PlasmaComponents.CheckBox {
id: solidBackground
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
text: i18n("Solid Background")
checked: plasmoid.configuration.solidPanel
enabled: showBackground.checked
onClicked: {
plasmoid.configuration.solidPanel = checked
}
}
}
RowLayout { RowLayout {
Layout.fillWidth: true Layout.fillWidth: true
Layout.leftMargin: units.smallSpacing * 2 Layout.leftMargin: units.smallSpacing * 2

Loading…
Cancel
Save