Skip to content

Commit 444311f

Browse files
committed
feat: add option to disable native panel background shadow
This change doesn't actually remove the shadow, just overrides the margins so it renders off screen. See https://github.com/KDE/plasma-workspace/blob/100cbc318708538b4ef7a8d619e51986d5d9f038/shell/panelview.cpp#L1903 refs: #59
1 parent 034e9b9 commit 444311f

File tree

3 files changed

+37
-2
lines changed

3 files changed

+37
-2
lines changed

package/contents/ui/code/globals.js

+1
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ const defaultConfig = {
249249
nativePanelBackground: {
250250
enabled: true,
251251
opacity: 1.0,
252+
shadow: true,
252253
},
253254
stockPanelSettings: baseStockPanelSettings,
254255
configurationOverrides: {

package/contents/ui/components/FormWidgetSettings.qml

+21-2
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,29 @@ ColumnLayout {
111111

112112
RowLayout {
113113
visible: keyName === "panel"
114+
enabled: nativePanelBackgroundCheckbox.checked
114115

115116
Label {
116-
text: i18n("Panel Opacity:")
117+
text: i18n("Native panel background shadow:")
118+
}
119+
120+
CheckBox {
121+
id: nativePanelBackgroundShadowCheckbox
122+
123+
checked: config.nativePanelBackground.shadow
124+
onCheckedChanged: {
125+
config.nativePanelBackground.shadow = checked;
126+
updateConfig();
127+
}
128+
}
129+
}
130+
131+
RowLayout {
132+
visible: keyName === "panel"
133+
enabled: nativePanelBackgroundCheckbox.checked
134+
135+
Label {
136+
text: i18n("Native panel background opacity:")
117137
}
118138

119139
SpinBoxDecimal {
@@ -125,7 +145,6 @@ ColumnLayout {
125145
config.nativePanelBackground.opacity = value;
126146
updateConfig();
127147
}
128-
enabled: nativePanelBackgroundCheckbox.checked
129148
}
130149

131150
Kirigami.ContextualHelpButton {

package/contents/ui/main.qml

+15
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ PlasmoidItem {
5555
property bool isEnabled: plasmoid.configuration.isEnabled
5656
property bool nativePanelBackgroundEnabled: (isEnabled ? cfg.nativePanelBackground.enabled : true) || doPanelClickFix
5757
property real nativePanelBackgroundOpacity: isEnabled ? cfg.nativePanelBackground.opacity : 1.0
58+
property bool nativePanelBackgroundShadowEnabled: isEnabled ? cfg.nativePanelBackground.shadow : true
5859
property var panelWidgets: []
5960
property int panelWidgetsCount: panelWidgets?.length || 0
6061
property real trayItemThikness: 20
@@ -1175,6 +1176,20 @@ PlasmoidItem {
11751176
when: (panelColorizer !== null && blurMask && panelColorizer?.hasRegions && (panelSettings.blurBehind || anyWidgetDoingBlur || anyTrayItemDoingBlur))
11761177
}
11771178

1179+
Binding {
1180+
target: panelElement
1181+
property: "topShadowMargin"
1182+
value: -panelView.height - 8
1183+
when: !nativePanelBackgroundShadowEnabled
1184+
}
1185+
1186+
Binding {
1187+
target: panelElement
1188+
property: "bottomShadowMargin"
1189+
value: -panelView.height - 8
1190+
when: !nativePanelBackgroundShadowEnabled
1191+
}
1192+
11781193
// The panel doesn't like having its spacings set to 0
11791194
// while adding/dragging widgets in edit mode, so temporary restore them
11801195
Binding {

0 commit comments

Comments
 (0)