OPtimization: Notification History only loaded when necessary

This commit is contained in:
LemmyCook 2025-08-25 21:54:03 -04:00
parent fcedb65119
commit d2563db5a0
3 changed files with 178 additions and 176 deletions

View file

@ -12,7 +12,7 @@ import qs.Widgets
Variants {
model: Quickshell.screens
Loader {
delegate: Loader {
required property ShellScreen modelData
readonly property real scaling: ScalingService.scale(modelData)

View file

@ -12,12 +12,11 @@ import qs.Widgets
Variants {
model: Quickshell.screens
PanelWindow {
delegate: Loader {
id: root
required property ShellScreen modelData
readonly property real scaling: ScalingService.scale(screen)
screen: modelData
readonly property real scaling: ScalingService.scale(modelData)
// Access the notification model from the service
property ListModel notificationModel: NotificationService.notificationModel
@ -25,13 +24,15 @@ Variants {
// Track notifications being removed for animation
property var removingNotifications: ({})
color: Color.transparent
// If no notification display activated in settings, then show them all
visible: modelData ? (Settings.data.notifications.monitors.includes(modelData.name)
active: modelData ? (Settings.data.notifications.monitors.includes(modelData.name)
|| (Settings.data.notifications.monitors.length === 0))
&& (NotificationService.notificationModel.count > 0) : false
sourceComponent: PanelWindow {
screen: modelData
color: Color.transparent
// Position based on bar location
anchors.top: Settings.data.bar.position === "top"
anchors.bottom: Settings.data.bar.position === "bottom"
@ -223,3 +224,4 @@ Variants {
}
}
}
}

View file

@ -77,19 +77,19 @@ NPanel {
NIcon {
text: "notifications_off"
font.pointSize: Style.fontSizeXXXL * scaling
color: Color.mOnSurfaceVariant
color: Color.mOnSurface
Layout.alignment: Qt.AlignHCenter
}
NText {
text: "No notifications"
font.pointSize: Style.fontSizeL * scaling
color: Color.mOnSurfaceVariant
color: Color.mOnSurface
Layout.alignment: Qt.AlignHCenter
}
NText {
text: "Notifications will appear here when you receive them"
text: "Your notifications will show up here as they arrive."
font.pointSize: Style.fontSizeNormal * scaling
color: Color.mOnSurfaceVariant
Layout.alignment: Qt.AlignHCenter