refractor bar unread notif indicator, add count option in settings

This commit is contained in:
end-4
2025-10-12 23:35:59 +02:00
parent 6f138677a8
commit 78723402ee
4 changed files with 136 additions and 99 deletions
@@ -0,0 +1,39 @@
import QtQuick
import qs
import qs.services
import qs.modules.common
import qs.modules.common.widgets
MaterialSymbol {
id: root
readonly property bool showUnreadCount: Config.options.bar.indicators.notifications.showUnreadCount
text: Notifications.silent ? "notifications_paused" : "notifications"
iconSize: Appearance.font.pixelSize.larger
color: rightSidebarButton.colText
Rectangle {
id: notifPing
visible: !Notifications.silent && Notifications.unread > 0
anchors {
right: parent.right
top: parent.top
rightMargin: root.showUnreadCount ? 0 : 1
topMargin: root.showUnreadCount ? 0 : 3
}
radius: Appearance.rounding.full
color: Appearance.colors.colOnLayer0
z: 1
implicitHeight: root.showUnreadCount ? Math.max(notificationCounterText.implicitWidth, notificationCounterText.implicitHeight) : 8
implicitWidth: implicitHeight
StyledText {
id: notificationCounterText
visible: root.showUnreadCount
anchors.centerIn: parent
font.pixelSize: Appearance.font.pixelSize.smallest
color: Appearance.colors.colLayer0
text: Notifications.unread
}
}
}