1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-06 21:45:38 -05:00

configurable timeouts, keyboard improvements

This commit is contained in:
bbedward
2025-08-12 14:28:53 -04:00
parent acc8272994
commit 1e23c6b12c
12 changed files with 440 additions and 276 deletions

View File

@@ -63,7 +63,6 @@ PanelWindow {
SettingsData.notificationOverlayEnabled
// If overlay is enabled for all notifications, or if it's a critical notification
const shouldUseOverlay = (SettingsData.notificationOverlayEnabled) ||
(notificationData.urgency === NotificationUrgency.Critical)
@@ -398,7 +397,7 @@ PanelWindow {
StyledText {
id: actionText
text: modelData.text || ""
text: modelData.text || "View"
color: parent.isHovered ? Theme.primary : Theme.surfaceVariantText
font.pixelSize: Theme.fontSizeSmall
font.weight: Font.Medium

View File

@@ -172,16 +172,44 @@ QtObject {
if (activeWindows.length <= maxTargetNotifications + 1)
return
// Find the bottom-most non-critical notification to remove
const candidates = activeWindows.filter(p => {
return p.notificationData && p.notificationData.notification &&
p.notificationData.notification.urgency !== 2 // NotificationUrgency.Critical = 2
}).sort((a, b) => b.screenY - a.screenY) // Sort by Y position, highest first
const expiredCandidates = activeWindows.filter(p => {
if (!p.notificationData || !p.notificationData.notification) return false
if (p.notificationData.notification.urgency === 2) return false
const timeoutMs = p.notificationData.timer ? p.notificationData.timer.interval : 5000
if (timeoutMs === 0) return false
return !p.notificationData.timer.running
}).sort((a, b) => b.screenY - a.screenY)
const toRemove = candidates[0] // Get the bottom-most non-critical notification
if (toRemove && !toRemove.exiting) {
toRemove.notificationData.removedByLimit = true
toRemove.notificationData.popup = false
if (expiredCandidates.length > 0) {
const toRemove = expiredCandidates[0]
if (toRemove && !toRemove.exiting) {
toRemove.notificationData.removedByLimit = true
toRemove.notificationData.popup = false
}
return
}
const timeoutCandidates = activeWindows.filter(p => {
if (!p.notificationData || !p.notificationData.notification) return false
if (p.notificationData.notification.urgency === 2) return false
const timeoutMs = p.notificationData.timer ? p.notificationData.timer.interval : 5000
return timeoutMs > 0
}).sort((a, b) => {
const aTimeout = a.notificationData.timer ? a.notificationData.timer.interval : 5000
const bTimeout = b.notificationData.timer ? b.notificationData.timer.interval : 5000
if (aTimeout !== bTimeout) return aTimeout - bTimeout
return b.screenY - a.screenY
})
if (timeoutCandidates.length > 0) {
const toRemove = timeoutCandidates[0]
if (toRemove && !toRemove.exiting) {
toRemove.notificationData.removedByLimit = true
toRemove.notificationData.popup = false
}
}
}