feat: refactor notification system to manage hover states centrally and auto close
This commit is contained in:
@@ -12,13 +12,24 @@ Item {
|
||||
|
||||
property var focusedMonitor: null
|
||||
property var newestNotification: null
|
||||
property bool soundEnabled: true
|
||||
property bool notificationPopupEnabled: true
|
||||
|
||||
property alias trackedNotifications: notificationServer.trackedNotifications
|
||||
property int notificationNum: trackedNotifications.values.length
|
||||
|
||||
signal notificationReceived(var notification)
|
||||
|
||||
// ── Hover state for history auto-close ──
|
||||
// Updated by NotificationHistory.qml (PanelWindow hover) and NotificationButton.qml (bar button hover)
|
||||
property bool historyHovered: false
|
||||
property bool buttonHovered: false
|
||||
property int historyAutoCloseDelay: 1000
|
||||
signal closeHistoryRequested()
|
||||
|
||||
// Debug logging for hover transitions
|
||||
onHistoryHoveredChanged: Config.debug == "Notification" && console.log("[NotificationServer] historyHovered:", historyHovered)
|
||||
onButtonHoveredChanged: Config.debug == "Notification" && console.log("[NotificationServer] buttonHovered:", buttonHovered)
|
||||
|
||||
function correctMonitor(screen) {
|
||||
return (Hyprland.monitorFor(screen) === focusedMonitor)
|
||||
}
|
||||
@@ -83,7 +94,7 @@ Item {
|
||||
repeat: false
|
||||
|
||||
onTriggered: {
|
||||
if((!notification.lastGeneration && notificationServerState.soundEnabled) || Config.debug == "Notification"){
|
||||
if((!notification.lastGeneration && notificationServerState.notificationPopupEnabled) || Config.debug == "Notification"){
|
||||
focusedMonitor = Hyprland.focusedMonitor
|
||||
notificationReceived(notification)
|
||||
notificationSound.play()
|
||||
|
||||
Reference in New Issue
Block a user