use multieffect for shadows

This commit is contained in:
end-4
2025-05-20 12:58:39 +02:00
parent bece489ee9
commit fcdf2dc7f6
11 changed files with 100 additions and 125 deletions
@@ -7,6 +7,7 @@ import "./quickToggles/"
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Effects
import Qt5Compat.GraphicalEffects
import Quickshell.Io
import Quickshell
@@ -65,6 +66,16 @@ Scope {
color: Appearance.colors.colLayer0
radius: Appearance.rounding.screenRounding - Appearance.sizes.elevationMargin + 1
layer.enabled: true
layer.effect: MultiEffect {
source: sidebarRightBackground
anchors.fill: sidebarRightBackground
shadowEnabled: true
shadowColor: Appearance.colors.colShadow
shadowVerticalOffset: 1
shadowBlur: 0.5
}
Keys.onPressed: (event) => {
if (event.key === Qt.Key_Escape) {
sidebarRoot.hide();
@@ -164,17 +175,6 @@ Scope {
}
}
// Shadow
DropShadow {
anchors.fill: sidebarRightBackground
horizontalOffset: 0
verticalOffset: 2
radius: Appearance.sizes.elevationMargin
samples: Appearance.sizes.elevationMargin * 2 + 1 // Ideally should be 2 * radius + 1, see qt docs
color: Appearance.colors.colShadow
source: sidebarRightBackground
}
}
}