move NotifService and NotifItem to services/, keep notification UI in modules/

This commit is contained in:
Damocles 2026-04-18 00:26:14 +02:00
parent a17a365b81
commit d20fdf8fa0
8 changed files with 33 additions and 36 deletions

View file

@ -33,8 +33,8 @@ M.HoverPanel {
// DND toggle
Text {
text: M.NotifService.dnd ? "\uDB82\uDE93" : "\uDB80\uDC9C"
color: M.NotifService.dnd ? S.Theme.base09 : S.Theme.base04
text: S.NotifService.dnd ? "\uDB82\uDE93" : "\uDB80\uDC9C"
color: S.NotifService.dnd ? S.Theme.base09 : S.Theme.base04
font.pixelSize: S.Theme.fontSize
font.family: S.Theme.iconFontFamily
anchors.verticalCenter: parent.verticalCenter
@ -42,7 +42,7 @@ M.HoverPanel {
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: M.NotifService.toggleDnd()
onClicked: S.NotifService.toggleDnd()
}
}
@ -53,7 +53,7 @@ M.HoverPanel {
font.pixelSize: S.Theme.fontSize
font.family: S.Theme.iconFontFamily
anchors.verticalCenter: parent.verticalCenter
visible: M.NotifService.count > 0
visible: S.NotifService.count > 0
MouseArea {
id: clearArea
@ -88,7 +88,7 @@ M.HoverPanel {
// Group notifications by appName, sorted by max urgency desc then most recent time desc
readonly property var _groups: {
const map = {};
for (const n of M.NotifService.list) {
for (const n of S.NotifService.list) {
const key = n.appName || "";
if (!map[key])
map[key] = {
@ -167,14 +167,14 @@ M.HoverPanel {
}
function _cascadeDismiss() {
if (M.NotifService.list.length === 0)
if (S.NotifService.list.length === 0)
return;
const ids = M.NotifService.list.map(n => n.id);
const ids = S.NotifService.list.map(n => n.id);
_startCascade(_getVisibleNotifDelegates(), ids);
}
function _cascadeGroupDismiss(appName) {
const ids = M.NotifService.list.filter(n => n.appName === appName).map(n => n.id);
const ids = S.NotifService.list.filter(n => n.appName === appName).map(n => n.id);
if (ids.length === 0)
return;
_startCascade(_getVisibleNotifDelegates(appName), ids);
@ -184,7 +184,7 @@ M.HoverPanel {
const ids = _pendingDismissIds;
_pendingDismissIds = [];
for (const id of ids)
M.NotifService.dismiss(id);
S.NotifService.dismiss(id);
}
property Component _cascadeTimer: Component {
@ -467,7 +467,7 @@ M.HoverPanel {
ScriptAction {
script: {
if (notifDelegate._notif && !notifDelegate._skipDismiss)
M.NotifService.dismiss(notifDelegate._notif.id);
S.NotifService.dismiss(notifDelegate._notif.id);
}
}
}
@ -476,7 +476,7 @@ M.HoverPanel {
// Empty state
Text {
visible: M.NotifService.count === 0
visible: S.NotifService.count === 0
width: menuWindow.contentWidth
height: 48
horizontalAlignment: Text.AlignHCenter