forked from Shinonome/dots-hyprland
add option to show/hide unread notif count
This commit is contained in:
@@ -305,17 +305,25 @@ Item { // Bar content region
|
|||||||
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
|
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
id: notifPing
|
||||||
visible: !Notifications.silent && Notifications.unread > 0
|
visible: !Notifications.silent && Notifications.unread > 0
|
||||||
anchors.right: parent.right
|
property bool showUnreadCount: Config.options.bar.indicators.notifications.showUnreadCount
|
||||||
|
anchors {
|
||||||
|
right: parent.right
|
||||||
|
top: parent.top
|
||||||
|
rightMargin: showUnreadCount ? 0 : 1
|
||||||
|
topMargin: showUnreadCount ? 0 : 3
|
||||||
|
}
|
||||||
radius: Appearance.rounding.full
|
radius: Appearance.rounding.full
|
||||||
color: Appearance.colors.colOnLayer0
|
color: Appearance.colors.colOnLayer0
|
||||||
z: 1
|
z: 1
|
||||||
|
|
||||||
implicitHeight: Math.max(notificationCounterText.implicitWidth, notificationCounterText.implicitHeight)
|
implicitHeight: showUnreadCount ? Math.max(notificationCounterText.implicitWidth, notificationCounterText.implicitHeight) : 8
|
||||||
implicitWidth: Math.max(notificationCounterText.implicitWidth, notificationCounterText.implicitHeight)
|
implicitWidth: implicitHeight
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
id: notificationCounterText
|
id: notificationCounterText
|
||||||
|
visible: notifPing.showUnreadCount
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
font.pixelSize: Appearance.font.pixelSize.smallest
|
font.pixelSize: Appearance.font.pixelSize.smallest
|
||||||
color: Appearance.colors.colLayer0
|
color: Appearance.colors.colLayer0
|
||||||
|
|||||||
@@ -198,6 +198,11 @@ Singleton {
|
|||||||
property bool useUSCS: false // Instead of metric (SI) units
|
property bool useUSCS: false // Instead of metric (SI) units
|
||||||
property int fetchInterval: 10 // minutes
|
property int fetchInterval: 10 // minutes
|
||||||
}
|
}
|
||||||
|
property JsonObject indicators: JsonObject {
|
||||||
|
property JsonObject notifications: JsonObject {
|
||||||
|
property bool showUnreadCount: false
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
property JsonObject battery: JsonObject {
|
property JsonObject battery: JsonObject {
|
||||||
|
|||||||
Reference in New Issue
Block a user