mirror of
https://github.com/KDE/latte-dock.git
synced 2025-03-28 18:50:40 +03:00
respect different panel backgrounds from theme
--many plasma themes provide a different panel background per edge, with different styles or transparency levels. Latte now respects the plasma theme concerning the panel backgrounds found in a plasma theme. (cherry picked from commit 81d3a12e914126205c2a11b87070bf0dd6a30f5b)
This commit is contained in:
parent
72f7d3c4f1
commit
87f5650b3c
@ -137,8 +137,8 @@ Item{
|
||||
height: root.isVertical ? Math.min(parent.height + marginsHeight, root.height - marginsHeight) :
|
||||
panelSize + marginsHeight - (solidBackground.topIncreaser + solidBackground.bottomIncreaser)
|
||||
|
||||
imagePath: root.behaveAsPlasmaPanel || !Latte.WindowSystem.compositingActive || !root.panelShadowsActive ? "" : "widgets/panel-background"
|
||||
prefix: root.behaveAsPlasmaPanel || !Latte.WindowSystem.compositingActive || !root.panelShadowsActive ? "" : "shadow"
|
||||
imagePath: root.behaveAsPlasmaPanel || !Latte.WindowSystem.compositingActive || !root.panelShadowsActive || !hasElementPrefix("shadow") ? "" : "widgets/panel-background"
|
||||
prefix: root.behaveAsPlasmaPanel || !Latte.WindowSystem.compositingActive || !root.panelShadowsActive || !hasElementPrefix("shadow") ? "" : "shadow"
|
||||
|
||||
visible: (opacity == 0) ? false : true
|
||||
|
||||
@ -306,8 +306,14 @@ Item{
|
||||
onWidthChanged: updateEffectsArea();
|
||||
onHeightChanged: updateEffectsArea();
|
||||
|
||||
Component.onCompleted: root.updateEffectsArea.connect(updateEffectsArea);
|
||||
Component.onDestruction: root.updateEffectsArea.disconnect(updateEffectsArea);
|
||||
Component.onCompleted: {
|
||||
root.updateEffectsArea.connect(updateEffectsArea);
|
||||
adjustPrefix();
|
||||
}
|
||||
|
||||
Component.onDestruction: {
|
||||
root.updateEffectsArea.disconnect(updateEffectsArea);
|
||||
}
|
||||
|
||||
Binding{
|
||||
target: root
|
||||
@ -323,6 +329,10 @@ Item{
|
||||
solidBackground.updateEffectsArea();
|
||||
}
|
||||
}
|
||||
|
||||
onSolidPanelChanged: {
|
||||
adjustPrefix();
|
||||
}
|
||||
}
|
||||
|
||||
//! Fix for FrameSvgItem QML version not updating its margins after a theme change
|
||||
@ -331,12 +341,18 @@ Item{
|
||||
Connections{
|
||||
target: dock
|
||||
onThemeChanged: {
|
||||
solidBackground.adjustPrefix();
|
||||
plasmoid.configuration.panelShadows = !plasmoid.configuration.panelShadows;
|
||||
plasmoid.configuration.panelShadows = !plasmoid.configuration.panelShadows;
|
||||
updateEffectsArea();
|
||||
}
|
||||
}
|
||||
|
||||
Connections{
|
||||
target: plasmoid
|
||||
onLocationChanged: solidBackground.adjustPrefix();
|
||||
}
|
||||
|
||||
function updateEffectsArea(){
|
||||
if (!dock || root.editMode)
|
||||
return;
|
||||
@ -448,11 +464,8 @@ Item{
|
||||
default:
|
||||
prefix = "";
|
||||
}
|
||||
if (hasElementPrefix(pre)) {
|
||||
prefix = pre;
|
||||
} else {
|
||||
prefix = "";
|
||||
}
|
||||
|
||||
prefix = [pre, ""];
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user