mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-27 06:52:50 -05:00
Migrate notification system to native Quickshell NotificationServer API
- Replace custom NotificationGroupingService with native NotificationService - Implement proper image/icon priority system (notification image → app icon → fallback) - Add NotificationItem with image layering and elegant emoji fallbacks - Create native popup and history components with smooth animations - Fix Discord/Vesktop avatar display issues - Clean up legacy notification components and demos - Improve Material Design 3 theming consistency
This commit is contained in:
97
Tests/NotificationNativeDemo.qml
Normal file
97
Tests/NotificationNativeDemo.qml
Normal file
@@ -0,0 +1,97 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import "../Common"
|
||||
import "../Services"
|
||||
import "../Widgets"
|
||||
|
||||
ApplicationWindow {
|
||||
id: demoWindow
|
||||
width: 800
|
||||
height: 600
|
||||
visible: true
|
||||
title: "Native Notification System Demo"
|
||||
|
||||
color: Theme.background
|
||||
|
||||
Column {
|
||||
anchors.centerIn: parent
|
||||
spacing: Theme.spacingL
|
||||
|
||||
Text {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: "Native Notification System Demo"
|
||||
font.pixelSize: Theme.fontSizeXLarge
|
||||
color: Theme.surfaceText
|
||||
font.weight: Font.Bold
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: "This demo uses Quickshell's native NotificationServer"
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
color: Theme.onSurfaceVariant
|
||||
}
|
||||
|
||||
Row {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
spacing: Theme.spacingL
|
||||
|
||||
Button {
|
||||
text: "Show Popups"
|
||||
onClicked: notificationPopup.visible = true
|
||||
}
|
||||
|
||||
Button {
|
||||
text: "Show History"
|
||||
onClicked: notificationHistory.notificationHistoryVisible = true
|
||||
}
|
||||
|
||||
Button {
|
||||
text: "Clear All"
|
||||
onClicked: NotificationService.clearAllNotifications()
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
spacing: Theme.spacingM
|
||||
|
||||
Text {
|
||||
text: `Total Notifications: ${NotificationService.notifications.length}`
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
color: Theme.surfaceText
|
||||
}
|
||||
|
||||
Text {
|
||||
text: `Active Popups: ${NotificationService.popups.length}`
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
color: Theme.surfaceText
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
width: 600
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: "Instructions:\n" +
|
||||
"• Send notifications from other applications (Discord, etc.)\n" +
|
||||
"• Use 'notify-send' command to test\n" +
|
||||
"• Notifications will appear automatically in the popup\n" +
|
||||
"• Images from Discord/Vesktop will show as avatars\n" +
|
||||
"• App icons are automatically detected"
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.onSurfaceVariant
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
}
|
||||
|
||||
// Native notification popup
|
||||
NotificationPopupNative {
|
||||
id: notificationPopup
|
||||
}
|
||||
|
||||
// Native notification history
|
||||
NotificationHistoryNative {
|
||||
id: notificationHistory
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user