Introduced Notification server, and added background thorugh quickshell

This commit is contained in:
2025-09-13 23:51:14 -04:00
parent 55a97da636
commit 7081a48426
13 changed files with 263 additions and 10 deletions

69
osd/NotificationPanel.qml Normal file
View File

@@ -0,0 +1,69 @@
import QtQuick
import QtQuick.Layouts
import Quickshell
import Quickshell.Wayland
import Quickshell.Services.Notifications
import qs
import qs.common
Scope {
id: root
property bool visible: false
property int panelWidth: 350
Loader {
id: notificationPanelLoader
active: GlobalStates.notificationPanelOpen
/**
onActiveChanged: {
if (!notificationPanelLoader.active & NotificationServer.amountNotifications == 0) {
GlobalStates.notificationPanelOpen = false;
}
}
//*/
sourceComponent: PanelWindow {
id: notificationPanelRoot
visible: true
exclusionMode: ExclusionMode.Ignore
exclusiveZone: 0
implicitWidth: root.panelWidth
anchors {
top: true
right: true
bottom: true
}
margins {
top: Config.options.bar.height
}
Rectangle {
anchors {
fill: parent
margins: Config.options.bar.cornerStyle === 1 ? (Appearance.sizes.hyprlandGapsOut) : 0
}
color: Config.options.bar.showBackground ? Appearance.colors.colLayer1 : "transparent"
}
ColumnLayout {
id: notifs
anchors.margins: 4
anchors.left: parent.left
anchors.right: parent.right
Repeater {
model: NotificationService.notifications
NotificationItem {
required property Notification modelData
notif: modelData
textWidth: root.panelWidth - 14
notificationRounding: Appearance.rounding.unsharpenmore
}
}
}
}
}
}