[gnome-shell] telepathyClient: update the avatar correctly when it changes
- From: Marina Zhurakhinskaya <marinaz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] telepathyClient: update the avatar correctly when it changes
- Date: Thu, 22 Sep 2011 17:28:06 +0000 (UTC)
commit 131da5f52391c91f9446708f548a23d229a00934
Author: Marina Zhurakhinskaya <marinaz redhat com>
Date: Wed Sep 21 16:46:08 2011 -0400
telepathyClient: update the avatar correctly when it changes
Previously, when the avatar changed, we would not update the summary icon
for the source at all and would only update the notification icon when the
next message was received. Instead, we should update both immediately upon
recieving the signal that the avatar has changed.
https://bugzilla.gnome.org/show_bug.cgi?id=659768
js/ui/messageTray.js | 2 ++
js/ui/telepathyClient.js | 14 +++++++-------
2 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index ef0d593..d41fd7d 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -416,6 +416,7 @@ Notification.prototype = {
_init: function(source, title, banner, params) {
this.source = source;
+ this.title = title;
this.urgency = Urgency.NORMAL;
this.resident = false;
// 'transient' is a reserved keyword in JS, so we have to use an alternate variable name
@@ -538,6 +539,7 @@ Notification.prototype = {
y_fill: false,
y_align: St.Align.START });
+ this.title = title;
title = title ? _fixMarkup(title.replace(/\n/g, ' '), params.titleMarkup) : '';
this._titleLabel.clutter_text.set_markup('<b>' + title + '</b>');
diff --git a/js/ui/telepathyClient.js b/js/ui/telepathyClient.js
index cf55b16..4bd5097 100644
--- a/js/ui/telepathyClient.js
+++ b/js/ui/telepathyClient.js
@@ -543,13 +543,6 @@ ChatSource.prototype = {
createNotificationIcon: function() {
this._iconBox = new St.Bin({ style_class: 'avatar-box' });
this._iconBox._size = this.ICON_SIZE;
-
- this._updateAvatarIcon();
-
- return this._iconBox;
- },
-
- _updateAvatarIcon: function() {
let textureCache = St.TextureCache.get_default();
let file = this._contact.get_avatar_file();
@@ -561,6 +554,13 @@ ChatSource.prototype = {
icon_type: St.IconType.FULLCOLOR,
icon_size: this._iconBox._size });
}
+
+ return this._iconBox;
+ },
+
+ _updateAvatarIcon: function() {
+ this._setSummaryIcon(this.createNotificationIcon());
+ this._notification.update(this._notification.title, null, { customContent: true, icon: this.createNotificationIcon() });
},
open: function(notification) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]