protect floating views appearance

--floating views is a strange situation for which
plasma theme do not have any way to be protected for
their drawing (there is a chance that shadows and content
overlap). Latte in order to protect from that situation
now uses the auto-discovered plasma theme roundness to be used
in order to calculate the minimum thicknes for panel
background.
pull/11/head
Michail Vourlakos 5 years ago
parent a9aeb81d62
commit 5288aa6e38

@ -458,23 +458,55 @@ Item{
} }
} }
Binding {
target: root
property: "panelThickMarginBase"
value: {
var minimum = root.screenEdgeMarginEnabled && themeExtended ? themeExtended.topEdgeRoundness : 0;
if (root.useThemePanel){
if (root.isVertical){
if (plasmoid.location === PlasmaCore.Types.LeftEdge) {
return Math.max(minimum, solidBackground.margins.left);
} else if (plasmoid.location === PlasmaCore.Types.RightEdge) {
return Math.max(minimum, solidBackground.margins.right);
}
} else {
if (plasmoid.location === PlasmaCore.Types.BottomEdge) {
return Math.max(minimum, solidBackground.margins.bottom);
} else if (plasmoid.location === PlasmaCore.Types.TopEdge) {
return Math.max(minimum, solidBackground.margins.top);
}
}
} else {
return 0;
}
}
}
Binding { Binding {
target: root target: root
property: "panelThickMarginHigh" property: "panelThickMarginHigh"
value: { value: {
var minimum = root.screenEdgeMarginEnabled && themeExtended ? themeExtended.topEdgeRoundness : 0;
if (root.useThemePanel){ if (root.useThemePanel){
if (root.isVertical){ if (root.isVertical){
if (plasmoid.location === PlasmaCore.Types.LeftEdge) if (plasmoid.location === PlasmaCore.Types.LeftEdge) {
return solidBackground.margins.right; return Math.max(minimum, solidBackground.margins.right);
else if (plasmoid.location === PlasmaCore.Types.RightEdge) } else if (plasmoid.location === PlasmaCore.Types.RightEdge) {
return solidBackground.margins.left; return Math.max(minimum, solidBackground.margins.left);
}
} else { } else {
if (plasmoid.location === PlasmaCore.Types.BottomEdge) if (plasmoid.location === PlasmaCore.Types.BottomEdge) {
return solidBackground.margins.top; return Math.max(minimum, solidBackground.margins.top);
else if (plasmoid.location === PlasmaCore.Types.TopEdge) } else if (plasmoid.location === PlasmaCore.Types.TopEdge) {
return solidBackground.margins.bottom; return Math.max(minimum, solidBackground.margins.bottom);
} }
} }
} else {
return 0;
}
} }
} }

@ -384,7 +384,7 @@ Item {
} }
property int themePanelThickness: { property int themePanelThickness: {
var panelBase = root.panelThickMarginHigh; var panelBase = root.panelThickMarginHigh + root.panelThickMarginBase;
var margin = shrinkThickMargins ? 0 : thickMargins + localScreenEdgeMargin; var margin = shrinkThickMargins ? 0 : thickMargins + localScreenEdgeMargin;
var maxPanelSize = (iconSize + margin) - panelBase; var maxPanelSize = (iconSize + margin) - panelBase;
var percentage = Latte.WindowSystem.compositingActive ? plasmoid.configuration.panelSize/100 : 1; var percentage = Latte.WindowSystem.compositingActive ? plasmoid.configuration.panelSize/100 : 1;

Loading…
Cancel
Save