unlockDialog: Only show count for multiple notifications

In the common case where we only have a single unread notification
from a particular app, the count doesn't add useful information.
Reduce clutter a bit by only showing the notification count if we
have at least two.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/997
This commit is contained in:
Florian Müllner 2020-02-13 19:06:51 +01:00
parent b58eaeb3e7
commit ccc64e2621

View File

@ -99,6 +99,7 @@ var NotificationsBox = GObject.registerClass({
let count = source.unseenCount; let count = source.unseenCount;
let countLabel = new St.Label({ let countLabel = new St.Label({
text: `${count}`, text: `${count}`,
visible: count > 1,
style_class: 'unlock-dialog-notification-count-text', style_class: 'unlock-dialog-notification-count-text',
}); });
textBox.add(countLabel); textBox.add(countLabel);
@ -262,6 +263,7 @@ var NotificationsBox = GObject.registerClass({
} else { } else {
let count = source.unseenCount; let count = source.unseenCount;
obj.countLabel.text = `${count}`; obj.countLabel.text = `${count}`;
obj.countLabel.visible = count > 1;
} }
obj.sourceBox.visible = obj.visible && (source.unseenCount > 0); obj.sourceBox.visible = obj.visible && (source.unseenCount > 0);