move NotifService and NotifItem to services/, keep notification UI in modules/
This commit is contained in:
parent
a17a365b81
commit
d20fdf8fa0
8 changed files with 33 additions and 36 deletions
|
|
@ -8,28 +8,28 @@ M.BarSection {
|
|||
id: root
|
||||
spacing: S.Theme.moduleSpacing
|
||||
tooltip: {
|
||||
const parts = [M.NotifService.count + " notification" + (M.NotifService.count !== 1 ? "s" : "")];
|
||||
if (M.NotifService.dnd)
|
||||
const parts = [S.NotifService.count + " notification" + (S.NotifService.count !== 1 ? "s" : "")];
|
||||
if (S.NotifService.dnd)
|
||||
parts.push("Do not disturb");
|
||||
return parts.join("\n");
|
||||
}
|
||||
|
||||
required property var bar
|
||||
|
||||
readonly property bool hasUrgent: M.NotifService.list.some(n => n.urgency === NotificationUrgency.Critical && n.state !== "dismissed")
|
||||
readonly property bool hasUrgent: S.NotifService.list.some(n => n.urgency === NotificationUrgency.Critical && n.state !== "dismissed")
|
||||
|
||||
M.BarIcon {
|
||||
icon: {
|
||||
if (M.NotifService.dnd)
|
||||
return M.NotifService.count > 0 ? "\uDB80\uDCA0" : "\uDB82\uDE93";
|
||||
return M.NotifService.count > 0 ? "\uDB84\uDD6B" : "\uDB80\uDC9C";
|
||||
if (S.NotifService.dnd)
|
||||
return S.NotifService.count > 0 ? "\uDB80\uDCA0" : "\uDB82\uDE93";
|
||||
return S.NotifService.count > 0 ? "\uDB84\uDD6B" : "\uDB80\uDC9C";
|
||||
}
|
||||
color: M.NotifService.dnd ? S.Theme.base04 : root.accentColor
|
||||
color: S.NotifService.dnd ? S.Theme.base04 : root.accentColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
M.BarLabel {
|
||||
id: countLabel
|
||||
label: M.NotifService.count > 0 ? String(M.NotifService.count) + (root.hasUrgent ? "!" : "") : ""
|
||||
label: S.NotifService.count > 0 ? String(S.NotifService.count) + (root.hasUrgent ? "!" : "") : ""
|
||||
color: root.hasUrgent ? S.Theme.base08 : root.accentColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
|
|
@ -61,9 +61,9 @@ M.BarSection {
|
|||
}
|
||||
|
||||
Connections {
|
||||
target: M.NotifService
|
||||
target: S.NotifService
|
||||
function onCountChanged() {
|
||||
if (M.NotifService.count > 0)
|
||||
if (S.NotifService.count > 0)
|
||||
popAnim.start();
|
||||
}
|
||||
}
|
||||
|
|
@ -77,7 +77,7 @@ M.BarSection {
|
|||
}
|
||||
TapHandler {
|
||||
acceptedButtons: Qt.RightButton
|
||||
onTapped: M.NotifService.toggleDnd()
|
||||
onTapped: S.NotifService.toggleDnd()
|
||||
}
|
||||
|
||||
LazyLoader {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue