1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-16 10:42:06 -04:00

(frame): QOL Control Center & Notification updates

This commit is contained in:
purian23
2026-04-16 00:06:34 -04:00
parent 59160ce5ac
commit c11069d502
10 changed files with 637 additions and 463 deletions

View File

@@ -537,21 +537,21 @@ PanelWindow {
Behavior on shadowBlurPx {
NumberAnimation {
duration: Theme.shortDuration
duration: win.descriptionExpanded ? Theme.notificationExpandDuration : Theme.shortDuration
easing.type: Theme.standardEasing
}
}
Behavior on shadowOffsetX {
NumberAnimation {
duration: Theme.shortDuration
duration: win.descriptionExpanded ? Theme.notificationExpandDuration : Theme.shortDuration
easing.type: Theme.standardEasing
}
}
Behavior on shadowOffsetY {
NumberAnimation {
duration: Theme.shortDuration
duration: win.descriptionExpanded ? Theme.notificationExpandDuration : Theme.shortDuration
easing.type: Theme.standardEasing
}
}
@@ -566,7 +566,7 @@ PanelWindow {
shadowOffsetX: content.shadowOffsetX
shadowOffsetY: content.shadowOffsetY
shadowColor: content.shadowsAllowed && content.elevLevel ? Theme.elevationShadowColor(content.elevLevel) : "transparent"
shadowEnabled: !win._isDestroying && win.screenValid && content.shadowsAllowed
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
@@ -578,39 +578,39 @@ PanelWindow {
sourceRect.radius: win.connectedFrameMode ? Theme.connectedSurfaceRadius : Theme.cornerRadius
sourceRect.color: win.connectedFrameMode ? Theme.popupLayerColor(Theme.surfaceContainer) : Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
sourceRect.antialiasing: true
sourceRect.layer.enabled: win.connectedFrameMode
sourceRect.layer.smooth: true
sourceRect.layer.textureSize: win.connectedFrameMode && win.dpr > 1 ? Qt.size(Math.ceil(sourceRect.width * win.dpr), Math.ceil(sourceRect.height * win.dpr)) : Qt.size(0, 0)
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
}
Rectangle {
x: bgShadowLayer.sourceRect.x
y: bgShadowLayer.sourceRect.y
width: bgShadowLayer.sourceRect.width
height: bgShadowLayer.sourceRect.height
radius: bgShadowLayer.sourceRect.radius
visible: notificationData && notificationData.urgency === NotificationUrgency.Critical
opacity: 1
clip: true
// Keep critical accent outside shadow rendering so connected mode still shows it.
Rectangle {
x: content.cardInset
y: content.cardInset
width: Math.max(0, content.width - content.cardInset * 2)
height: Math.max(0, content.height - content.cardInset * 2)
radius: win.connectedFrameMode ? Theme.connectedSurfaceRadius : Theme.cornerRadius
visible: win.notificationData && win.notificationData.urgency === NotificationUrgency.Critical
opacity: 1
clip: true
gradient: Gradient {
orientation: Gradient.Horizontal
gradient: Gradient {
orientation: Gradient.Horizontal
GradientStop {
position: 0
color: Theme.primary
}
GradientStop {
position: 0
color: Theme.primary
}
GradientStop {
position: 0.02
color: Theme.primary
}
GradientStop {
position: 0.02
color: Theme.primary
}
GradientStop {
position: 0.021
color: "transparent"
}
GradientStop {
position: 0.021
color: "transparent"
}
}
}

View File

@@ -36,6 +36,7 @@ QtObject {
property var pendingDestroys: []
property int destroyDelayMs: 100
property bool _chromeSyncPending: false
property bool _syncingVisibleNotifications: false
readonly property real chromeOpenProgressThreshold: 0.10
readonly property real chromeReleaseTailStart: 0.90
readonly property real chromeReleaseDropProgress: 0.995
@@ -160,6 +161,7 @@ QtObject {
function _sync(newWrappers) {
let needsReposition = false;
_syncingVisibleNotifications = true;
for (const p of popupWindows.slice()) {
if (!_isValidWindow(p) || p.exiting)
continue;
@@ -171,10 +173,10 @@ QtObject {
}
for (const w of newWrappers) {
if (w && !_hasWindowFor(w) && _isFocusedScreen()) {
_insertAtTop(w);
needsReposition = false;
needsReposition = _insertAtTop(w, true) || needsReposition;
}
}
_syncingVisibleNotifications = false;
if (needsReposition)
_repositionAll();
}
@@ -183,9 +185,9 @@ QtObject {
return (p.alignedHeight || p.implicitHeight || (baseNotificationHeight - popupSpacing)) + popupSpacing;
}
function _insertAtTop(wrapper) {
function _insertAtTop(wrapper, deferReposition) {
if (!wrapper)
return;
return false;
const notificationId = wrapper?.notification ? wrapper.notification.id : "";
const win = popupComponent.createObject(null, {
"notificationData": wrapper,
@@ -194,15 +196,17 @@ QtObject {
"screen": manager.modelData
});
if (!win)
return;
return false;
if (!win.hasValidData) {
win.destroy();
return;
return false;
}
popupWindows.unshift(win);
_repositionAll();
if (!deferReposition)
_repositionAll();
if (!sweeper.running)
sweeper.start();
return true;
}
function _repositionAll() {
@@ -321,6 +325,10 @@ QtObject {
if (!rect || p !== trailing || !p.popupChromeReleaseProgress)
return rect;
// Keep maxed-stack chrome anchored while a replacement tail exits.
if (p.exiting && p.notificationData?.removedByLimit && _layoutWindows().length > 0)
return rect;
const progress = _chromeReleaseTailProgress(p.popupChromeReleaseProgress());
if (progress <= 0)
return rect;
@@ -489,17 +497,34 @@ QtObject {
_scheduleNotificationChromeSync();
}
// Coalesce resize repositioning; exit-path moves remain immediate.
property bool _repositionPending: false
function _queueReposition() {
if (_repositionPending)
return;
_repositionPending = true;
Qt.callLater(_flushReposition);
}
function _flushReposition() {
_repositionPending = false;
_repositionAll();
}
function _onPopupHeightChanged(p) {
if (!p || p.exiting || p._isDestroying)
return;
if (popupWindows.indexOf(p) === -1)
return;
_repositionAll();
_queueReposition();
}
function _onPopupExitStarted(p) {
if (!p || popupWindows.indexOf(p) === -1)
return;
if (_syncingVisibleNotifications)
return;
_repositionAll();
}