mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-04 12:52:06 -04:00
feat: Implement Material Design 3 elevation and shadow effects
- Added global toggle for enabling M3 elevation & shadow effects - Refactored various components to sync updated specs
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import qs.Common
|
||||
@@ -377,6 +378,31 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
readonly property var elev: Theme.elevationLevel3
|
||||
readonly property real shadowBlurNorm: Math.max(0, Math.min(1, (elev && elev.blurPx !== undefined ? elev.blurPx : 12) / Theme.elevationBlurMax))
|
||||
|
||||
Rectangle {
|
||||
id: modalShadowShape
|
||||
anchors.fill: parent
|
||||
radius: root.cornerRadius
|
||||
color: "black"
|
||||
visible: false
|
||||
layer.enabled: root.enableShadow && Theme.elevationEnabled && Quickshell.env("DMS_DISABLE_LAYER") !== "true" && Quickshell.env("DMS_DISABLE_LAYER") !== "1"
|
||||
layer.smooth: false
|
||||
|
||||
layer.effect: MultiEffect {
|
||||
autoPaddingEnabled: true
|
||||
shadowEnabled: true
|
||||
blurEnabled: false
|
||||
maskEnabled: false
|
||||
shadowBlur: modalShadowShape.parent.shadowBlurNorm
|
||||
shadowScale: 1
|
||||
shadowVerticalOffset: modalShadowShape.parent.elev && modalShadowShape.parent.elev.offsetY !== undefined ? modalShadowShape.parent.elev.offsetY : 6
|
||||
shadowHorizontalOffset: 0
|
||||
shadowColor: Theme.elevationShadowColor(Theme.elevationLevel3)
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: root.backgroundColor
|
||||
|
||||
Reference in New Issue
Block a user