diff --git a/data/theme/gnome-shell.css b/data/theme/gnome-shell.css index 54b83ac1b..86b447d56 100644 --- a/data/theme/gnome-shell.css +++ b/data/theme/gnome-shell.css @@ -1222,6 +1222,12 @@ StScrollBar StButton#vhandle:active { outline: 1px solid rgba(128, 128, 128, 0.3); } +.no-messages-label { + font-family: cantarell, sans-serif; + font-size: 11pt; + color: #999999; +} + .notification { border-radius: 10px 10px 0px 0px; background: rgba(0,0,0,0.8); diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index 8fbc0b232..12895f9b2 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -1543,6 +1543,22 @@ const MessageTray = new Lang.Class({ this._trayDwellUserTime = 0; this._sessionUpdated(); + this._updateNoMessagesLabel(); + }, + + _updateNoMessagesLabel: function() { + if (this._summaryItems.length == 0 && !this._noMessages) { + this._noMessages = new St.Label({ text: _("No Messages"), + style_class: 'no-messages-label', + x_align: Clutter.ActorAlign.CENTER, + x_expand: true, + y_align: Clutter.ActorAlign.CENTER, + y_expand: true }); + this.actor.add_actor(this._noMessages); + } else if (this._summaryItems.length > 0 && this._noMessages) { + this._noMessages.destroy(); + this._noMessages = null; + } }, _sessionUpdated: function() { @@ -1687,6 +1703,8 @@ const MessageTray = new Lang.Class({ Meta.later_add(Meta.LaterType.BEFORE_REDRAW, Lang.bind(this, function() { this._updateState(); return false; })); this.emit('summary-item-added', summaryItem); + + this._updateNoMessagesLabel(); }, getSummaryItems: function() { @@ -1719,6 +1737,8 @@ const MessageTray = new Lang.Class({ summaryItemToRemove.actor.destroy(); + this._updateNoMessagesLabel(); + if (needUpdate) this._updateState(); },