feat: Introduce NotificationHistoryLoader to manage opening and closing the NotificationHistory panel.
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Hyprland
|
||||
import Quickshell.Io
|
||||
import "../../config"
|
||||
import "./notificationServer"
|
||||
|
||||
|
||||
Item { // container, invisible
|
||||
id: nHistoryLoader
|
||||
|
||||
LazyLoader {
|
||||
id: notifificationHistoryLoader
|
||||
// active: true
|
||||
active: false
|
||||
NotificationHistory {
|
||||
id: nHistory
|
||||
|
||||
function closeNHistory() {
|
||||
nHistoryLoader.closeNHistory()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GlobalShortcut {
|
||||
name: "NotificationHistory"
|
||||
description: "Open Notification History"
|
||||
|
||||
onPressed: {
|
||||
console.log("Pressed Meta+Shift+N (Hyprland global shortcut)")
|
||||
notifificationHistoryLoader.active = !notifificationHistoryLoader.active
|
||||
}
|
||||
}
|
||||
|
||||
function openNHistory() {
|
||||
notifificationHistoryLoader.active = true
|
||||
}
|
||||
|
||||
function closeNHistory() {
|
||||
notifificationHistoryLoader.active = false
|
||||
}
|
||||
|
||||
function toggleNHistory() {
|
||||
notifificationHistoryLoader.active = !notifificationHistoryLoader.active
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
console.log("[NotificationHistoryLoader]:", NotificationS)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user