[polari] roomList: Update header if account name changes



commit 0a81eaa07722b886933da739766c5fef7361bf6d
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Jul 24 22:48:05 2013 +0200

    roomList: Update header if account name changes

 src/roomList.js |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/roomList.js b/src/roomList.js
index 832111b..38e8996 100644
--- a/src/roomList.js
+++ b/src/roomList.js
@@ -1,3 +1,4 @@
+const GObject = imports.gi.GObject;
 const Gtk = imports.gi.Gtk;
 const Pango = imports.gi.Pango;
 
@@ -158,11 +159,13 @@ const RoomList = new Lang.Class({
             return;
         }
 
-        let label = new Gtk.Label({ label: account.display_name,
-                                    xalign: 0,
+        let label = new Gtk.Label({ xalign: 0,
                                     max_width_chars: 15,
                                     ellipsize: Pango.EllipsizeMode.END });
         label.get_style_context().add_class('room-list-header');
+
+        account.bind_property('display-name', label, 'label',
+                              GObject.BindingFlags.SYNC_CREATE);
         row.set_header(label);
     },
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]