[gnome-shell] Use createTimeLabel() where appropriate
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] Use createTimeLabel() where appropriate
- Date: Wed, 4 Mar 2015 12:55:59 +0000 (UTC)
commit d8505934e8a14bab12bf0c06cfa3574414a6ca1d
Author: Florian Müllner <fmuellner gnome org>
Date: Wed Feb 25 23:35:55 2015 +0100
Use createTimeLabel() where appropriate
https://bugzilla.gnome.org/show_bug.cgi?id=745111
js/ui/calendar.js | 8 ++++----
js/ui/components/telepathyClient.js | 10 ++++------
2 files changed, 8 insertions(+), 10 deletions(-)
---
diff --git a/js/ui/calendar.js b/js/ui/calendar.js
index 04bacea..721a08e 100644
--- a/js/ui/calendar.js
+++ b/js/ui/calendar.js
@@ -1574,10 +1574,10 @@ const NotificationSection = new Lang.Class({
_onNotificationAdded: function(source, notification) {
let message = new NotificationMessage(notification);
- let time = Util.formatTime(new Date());
- message.setSecondaryActor(new St.Label({ style_class: 'event-time',
- x_align: Clutter.ActorAlign.END,
- text: time }));
+ let timeLabel = Util.createTimeLabel(new Date());
+ timeLabel.style_class = 'event-time',
+ timeLabel.x_align = Clutter.ActorAlign.END;
+ message.setSecondaryActor(timeLabel);
let isUrgent = notification.urgency == MessageTray.Urgency.CRITICAL;
if (isUrgent) {
diff --git a/js/ui/components/telepathyClient.js b/js/ui/components/telepathyClient.js
index f2d1e87..e6ade40 100644
--- a/js/ui/components/telepathyClient.js
+++ b/js/ui/components/telepathyClient.js
@@ -751,12 +751,10 @@ const ChatNotification = new Lang.Class({
let lastMessageTime = this._history[0].time;
let lastMessageDate = new Date(lastMessageTime * 1000);
- let timeLabel = new St.Label({ text: Util.formatTime(lastMessageDate),
- style_class: 'chat-meta-message',
- x_expand: true,
- y_expand: true,
- x_align: Clutter.ActorAlign.END,
- y_align: Clutter.ActorAlign.END });
+ let timeLabel = Util.createTimeLabel(lastMessageDate);
+ timeLabel.style_class = 'chat-meta-message';
+ timeLabel.x_expand = timeLabel.y_expand = true;
+ timeLabel.x_align = timeLabel.y_align = Clutter.ActorAlign.END;
this._lastMessageBox.add_actor(timeLabel);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]