1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-06-15 07:35:20 -04:00

refactor(framemode): unify connected surface chrome via SDF pipeline

- Shadow system rewrite with SDF quads
- Replace ConnectedShape/layer FBOs w/frame & chrome SDF shaders
- Improve frame blur performance
- Plugin performance gate
This commit is contained in:
purian23
2026-06-12 11:03:39 -04:00
parent 08fd6e26d8
commit d53809cf2b
52 changed files with 2588 additions and 2804 deletions
@@ -31,7 +31,7 @@ Rectangle {
height: baseCardHeight + contentItem.extraHeight
radius: Theme.cornerRadius
clip: false
readonly property bool shadowsAllowed: Theme.elevationEnabled && Quickshell.env("DMS_DISABLE_LAYER") !== "true" && Quickshell.env("DMS_DISABLE_LAYER") !== "1" && !BlurService.enabled
readonly property bool shadowsAllowed: Theme.elevationEnabled && Quickshell.env("DMS_DISABLE_LAYER") !== "true" && Quickshell.env("DMS_DISABLE_LAYER") !== "1"
ElevationShadow {
id: shadowLayer
@@ -47,7 +47,7 @@ Rectangle {
readonly property real targetHeight: expanded ? (expandedContent.height + cardPadding * 2) : (baseCardHeight + collapsedContent.extraHeight)
radius: connectedFrameMode ? Theme.connectedSurfaceRadius : Theme.cornerRadius
scale: (cardHoverHandler.hovered ? 1.004 : 1.0) * listLevelAdjacentScaleInfluence
readonly property bool shadowsAllowed: Theme.elevationEnabled && Quickshell.env("DMS_DISABLE_LAYER") !== "true" && Quickshell.env("DMS_DISABLE_LAYER") !== "1" && !BlurService.enabled
readonly property bool shadowsAllowed: Theme.elevationEnabled && Quickshell.env("DMS_DISABLE_LAYER") !== "true" && Quickshell.env("DMS_DISABLE_LAYER") !== "1"
readonly property var shadowElevation: Theme.elevationLevel1
readonly property real baseShadowBlurPx: (shadowElevation && shadowElevation.blurPx !== undefined) ? shadowElevation.blurPx : 4
readonly property real hoverShadowBlurBoost: cardHoverHandler.hovered ? Math.min(2, baseShadowBlurPx * 0.25) : 0
@@ -641,21 +641,15 @@ PanelWindow {
shadowOffsetY: content.shadowOffsetY
shadowColor: content.shadowsAllowed && content.elevLevel ? Theme.elevationShadowColor(content.elevLevel) : "transparent"
shadowEnabled: !win._isDestroying && win.screenValid && content.shadowsAllowed && !win.connectedFrameMode
layer.textureSize: Qt.size(Math.round(width * win.dpr), Math.round(height * win.dpr))
layer.textureMirroring: ShaderEffectSource.MirrorVertically
sourceRect.anchors.fill: undefined
sourceRect.x: content.shadowRenderPadding + content.cardInset
sourceRect.y: content.shadowRenderPadding + content.cardInset
sourceRect.width: Math.max(0, content.width - (content.cardInset * 2))
sourceRect.height: Math.max(0, content.height - (content.cardInset * 2))
sourceRect.radius: win.connectedFrameMode ? Theme.connectedSurfaceRadius : Theme.cornerRadius
sourceRect.color: win.connectedFrameMode ? Theme.floatingSurface : Theme.readableSurface
sourceRect.antialiasing: true
sourceRect.layer.enabled: false
sourceRect.layer.textureSize: Qt.size(0, 0)
sourceRect.border.color: notificationData && notificationData.urgency === NotificationUrgency.Critical ? Theme.withAlpha(Theme.primary, 0.3) : Theme.withAlpha(Theme.outline, 0.08)
sourceRect.border.width: notificationData && notificationData.urgency === NotificationUrgency.Critical ? 2 : 0
sourceX: content.shadowRenderPadding + content.cardInset
sourceY: content.shadowRenderPadding + content.cardInset
sourceWidth: Math.max(0, content.width - (content.cardInset * 2))
sourceHeight: Math.max(0, content.height - (content.cardInset * 2))
targetRadius: win.connectedFrameMode ? Theme.connectedSurfaceRadius : Theme.cornerRadius
targetColor: win.connectedFrameMode ? Theme.floatingSurface : Theme.readableSurface
borderColor: win.notificationData && win.notificationData.urgency === NotificationUrgency.Critical ? Theme.withAlpha(Theme.primary, 0.3) : Theme.withAlpha(Theme.outline, 0.08)
borderWidth: win.notificationData && win.notificationData.urgency === NotificationUrgency.Critical ? 2 : 0
}
// Keep critical accent outside shadow rendering so connected mode still shows it.
@@ -513,13 +513,30 @@ QtObject {
ConnectedModeState.clearNotificationState(screenName);
return;
}
const bodyRect = {
x: minX,
y: minY,
width: maxXEnd - minX,
height: maxYEnd - minY
};
ConnectedModeState.setNotificationState(screenName, {
kind: "notification",
screenName: screenName,
phase: "open",
visible: true,
presented: true,
barSide: notifBarSide,
bodyRect: bodyRect,
animationOffset: {
x: 0,
y: 0
},
scale: 1,
opacity: Theme.connectedSurfaceColor.a,
bodyX: minX,
bodyY: minY,
bodyW: maxXEnd - minX,
bodyH: maxYEnd - minY,
bodyW: bodyRect.width,
bodyH: bodyRect.height,
omitStartConnector: _notificationOmitStartConnector(),
omitEndConnector: _notificationOmitEndConnector()
});