[polari] userList: Change nickname color on nick status change



commit 8bd801ab096f5f5775daf08b55c3ce66bc48724c
Author: Bastian Ilsø <bastianilso gnome org>
Date:   Thu Nov 10 20:44:56 2016 +0100

    userList: Change nickname color on nick status change
    
    We want to be consistent with the chatview in terms of styling,
    so change the nick label's color instead of the status label's one.

 data/resources/user-popover.ui |    1 +
 src/userList.js                |   12 ++++++------
 2 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/data/resources/user-popover.ui b/data/resources/user-popover.ui
index 9c677df..34c9e80 100644
--- a/data/resources/user-popover.ui
+++ b/data/resources/user-popover.ui
@@ -38,6 +38,7 @@
                     <property name="visible">True</property>
                     <style>
                       <class name="polari-user-popover-status" />
+                      <class name="dim-label" />
                     </style>
                   </object>
                 </child>
diff --git a/src/userList.js b/src/userList.js
index 17901e9..2456d7c 100644
--- a/src/userList.js
+++ b/src/userList.js
@@ -342,7 +342,7 @@ const UserPopover = new Lang.Class({
 
         this.parent(params);
 
-        this._statusLabel.set_state_flags(Gtk.StateFlags.LINK, false);
+        this._nickLabel.set_state_flags(Gtk.StateFlags.LINK, false);
 
         this._app = Gio.Application.get_default();
 
@@ -388,7 +388,7 @@ const UserPopover = new Lang.Class({
 
         if (this._globalStatusChangedId > 0)
             this._userTracker.disconnect(this._globalStatusChangedId);
-        this._globalStatusChangedId = this._userTracker.connect("status-changed::" + basenick, 
Lang.bind(this, this._updateStatusLabel));
+        this._globalStatusChangedId = this._userTracker.connect("status-changed::" + basenick, 
Lang.bind(this, this._onStatusChanged));
 
         if (this._contactsChangedId > 0)
             this._userTracker.disconnect(this._contactsChangedId);
@@ -396,7 +396,7 @@ const UserPopover = new Lang.Class({
             this._userDetails.user = this._userTracker.lookupContact(this._nickname);
         });
 
-        this._updateStatusLabel();
+        this._onStatusChanged();
         this._updateDetailsContact();
     },
 
@@ -404,7 +404,7 @@ const UserPopover = new Lang.Class({
         return this._nickname;
     },
 
-    _updateStatusLabel: function() {
+    _onStatusChanged: function() {
         let status = this._userTracker.getNickStatus(this._nickname);
         let roomStatus = this._userTracker.getNickRoomStatus(this._nickname,
                                                              this._room);
@@ -418,7 +418,7 @@ const UserPopover = new Lang.Class({
             label = _("Offline");
         this._statusLabel.label = label;
 
-        this._statusLabel.sensitive = (status == Tp.ConnectionPresenceType.AVAILABLE);
+        this._nickLabel.sensitive = (status == Tp.ConnectionPresenceType.AVAILABLE);
     },
 
     _updateDetailsContact: function() {
@@ -426,7 +426,7 @@ const UserPopover = new Lang.Class({
      },
 
     _onNickStatusChanged: function(baseNick, status) {
-        this._updateStatusLabel();
+        this._onStatusChanged();
     }
 });
 


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