import QtQuick import Quickshell import QtQuick.Controls import Quickshell.Wayland import Quickshell.Hyprland import Quickshell.Services.Notifications import "../../config" import "./notificationServer" PanelWindow { id: root implicitWidth: screen.width/5 implicitHeight: screen.height - Config.barHeight(screen.height)*2 color: "transparent" visible: true focusable: true anchors { top: true right: true } property string textColor: Colors.primary property string textBGColor: Qt.alpha(Colors.primaryContainer, 0.75) property string bGColor: Qt.alpha(Colors.primaryContainer, 0.5) property real bigFontSize: Config.screen_height_to_font_medium(screen.height) property real fontSize: Config.screen_height_to_font_small(screen.height) property var expandedGroups: ({}) property var grouped: { const vals = NotificationS.trackedNotifications.values const len = vals.length if (len < 0) return [] let map = {} for (let i = 0; i < vals.length; ++i) { const n = vals[i] const key = (n && n.appName && n.appName !== "") ? n.appName : "Unknown" if (!map[key]) map[key] = [] map[key].push(n) } let result = [] for (const k in map) result.push({ appName: k, notes: map[k] }) result.sort((a,b)=>a.appName.localeCompare(b.appName)) return result } function toggleGroup(appName) { let copy = Object.assign({}, expandedGroups) copy[appName] = !(copy[appName] === true) expandedGroups = copy } function clearGroup(appName) { const vals = NotificationS.trackedNotifications.values.slice() for (let i=0;i