Use createTimeLabel() where appropriate
https://bugzilla.gnome.org/show_bug.cgi?id=745111
This commit is contained in:
parent
8f424e7d96
commit
d8505934e8
@ -1574,10 +1574,10 @@ const NotificationSection = new Lang.Class({
|
|||||||
_onNotificationAdded: function(source, notification) {
|
_onNotificationAdded: function(source, notification) {
|
||||||
let message = new NotificationMessage(notification);
|
let message = new NotificationMessage(notification);
|
||||||
|
|
||||||
let time = Util.formatTime(new Date());
|
let timeLabel = Util.createTimeLabel(new Date());
|
||||||
message.setSecondaryActor(new St.Label({ style_class: 'event-time',
|
timeLabel.style_class = 'event-time',
|
||||||
x_align: Clutter.ActorAlign.END,
|
timeLabel.x_align = Clutter.ActorAlign.END;
|
||||||
text: time }));
|
message.setSecondaryActor(timeLabel);
|
||||||
|
|
||||||
let isUrgent = notification.urgency == MessageTray.Urgency.CRITICAL;
|
let isUrgent = notification.urgency == MessageTray.Urgency.CRITICAL;
|
||||||
if (isUrgent) {
|
if (isUrgent) {
|
||||||
|
@ -751,12 +751,10 @@ const ChatNotification = new Lang.Class({
|
|||||||
let lastMessageTime = this._history[0].time;
|
let lastMessageTime = this._history[0].time;
|
||||||
let lastMessageDate = new Date(lastMessageTime * 1000);
|
let lastMessageDate = new Date(lastMessageTime * 1000);
|
||||||
|
|
||||||
let timeLabel = new St.Label({ text: Util.formatTime(lastMessageDate),
|
let timeLabel = Util.createTimeLabel(lastMessageDate);
|
||||||
style_class: 'chat-meta-message',
|
timeLabel.style_class = 'chat-meta-message';
|
||||||
x_expand: true,
|
timeLabel.x_expand = timeLabel.y_expand = true;
|
||||||
y_expand: true,
|
timeLabel.x_align = timeLabel.y_align = Clutter.ActorAlign.END;
|
||||||
x_align: Clutter.ActorAlign.END,
|
|
||||||
y_align: Clutter.ActorAlign.END });
|
|
||||||
|
|
||||||
this._lastMessageBox.add_actor(timeLabel);
|
this._lastMessageBox.add_actor(timeLabel);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user