notifications: show ! suffix and red color on count when critical notifications present
This commit is contained in:
parent
b31fab5148
commit
d6b1a7ae58
1 changed files with 5 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import Quickshell
|
import Quickshell
|
||||||
|
import Quickshell.Services.Notifications
|
||||||
import "." as M
|
import "." as M
|
||||||
|
|
||||||
M.BarSection {
|
M.BarSection {
|
||||||
|
|
@ -14,6 +15,8 @@ M.BarSection {
|
||||||
|
|
||||||
required property var bar
|
required property var bar
|
||||||
|
|
||||||
|
readonly property bool hasUrgent: M.NotifService.list.some(n => n.urgency === NotificationUrgency.Critical && n.state !== "dismissed")
|
||||||
|
|
||||||
M.BarIcon {
|
M.BarIcon {
|
||||||
icon: {
|
icon: {
|
||||||
if (M.NotifService.dnd)
|
if (M.NotifService.dnd)
|
||||||
|
|
@ -25,7 +28,8 @@ M.BarSection {
|
||||||
}
|
}
|
||||||
M.BarLabel {
|
M.BarLabel {
|
||||||
id: countLabel
|
id: countLabel
|
||||||
label: M.NotifService.count > 0 ? String(M.NotifService.count) : ""
|
label: M.NotifService.count > 0 ? String(M.NotifService.count) + (root.hasUrgent ? "!" : "") : ""
|
||||||
|
color: root.hasUrgent ? M.Theme.base08 : root.accentColor
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
transform: Scale {
|
transform: Scale {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue