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::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);
break;
@ -295,9 +295,11 @@ QRegion DockCorona::availableScreenRegion(int id) const
}
/*qDebug() << "::::: FREE AREAS :::::";
for (int i = 0; i < available.rectCount(); ++i) {
qDebug() << available.rects().at(i);
}
qDebug() << "::::: END OF FREE AREAS :::::";*/
return available;

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

@ -99,8 +99,10 @@ Item{
PlasmaCore.FrameSvgItem{
id: shadowsSvgItem
width: root.isVertical ? panelSize + marginsWidth : Math.min(parent.width + marginsWidth, root.width - marginsWidth)
height: root.isVertical ? Math.min(parent.height + marginsHeight, root.height - marginsHeight) : panelSize + marginsHeight
width: root.isVertical ? panelSize + marginsWidth - (solidBackground.leftIncreaser + solidBackground.rightIncreaser) :
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"
prefix: root.drawShadowsExternal ? "" : "shadow"
@ -194,13 +196,44 @@ Item{
PlasmaCore.FrameSvgItem{
id: solidBackground
anchors.leftMargin: shadowsSvgItem.margins.left
anchors.rightMargin: shadowsSvgItem.margins.right
anchors.topMargin: shadowsSvgItem.margins.top
anchors.bottomMargin: shadowsSvgItem.margins.bottom
anchors.leftMargin: shadowsSvgItem.margins.left - leftIncreaser
anchors.rightMargin: shadowsSvgItem.margins.right - rightIncreaser
anchors.topMargin: shadowsSvgItem.margins.top - topIncreaser
anchors.bottomMargin: shadowsSvgItem.margins.bottom - bottomIncreaser
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 {
target: root
@ -258,7 +291,12 @@ Item{
prefix = "";
}
}
}
PlasmaCore.FrameSvgItem{
id: hiddenPanelBackground
imagePath: "widgets/panel-background"
visible: false
}
}
@ -484,3 +522,4 @@ Item{
//END states
}

@ -50,7 +50,7 @@ DragDrop.DropArea {
property bool confirmedDragEntered: false
property bool drawShadowsExternal: visibilityManager.panelIsBiggerFromIconSize && (zoomFactor === 1.0)
&& (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 immutable: plasmoid.immutable
@ -61,6 +61,7 @@ DragDrop.DropArea {
: (layoutsContainer.hoveredIndex !== -1) //|| wholeArea.containsMouse
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 solidPanel: plasmoid.configuration.solidPanel
//FIXME: possibly this is going to be the default behavior, this user choice
//has been dropped from the Dock Configuration Window
//property bool smallAutomaticIconJumps: plasmoid.configuration.smallAutomaticIconJumps

@ -227,9 +227,18 @@ PlasmaComponents.Page {
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 {
id: showBackground
Layout.leftMargin: units.smallSpacing * 2
Layout.fillWidth: true
text: i18n("Show Panel Background")
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 {
Layout.fillWidth: true
Layout.leftMargin: units.smallSpacing * 2

Loading…
Cancel
Save