[polari/wip/kunaljain/bug-fixes: 3/3] chatView: Change color of status header on hover



commit 57f9e049ed5684be93af7fe90ed76b46e53b58e9
Author: Kunaal Jain <kunaalus gmail com>
Date:   Wed Dec 23 02:30:47 2015 +0530

    chatView: Change color of status header on hover
    
    Highlight the compressed status messages on hover
    by changing the color. The change helps indicating,
    that on hover the status message is clickable.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=759032

 src/chatView.js |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/chatView.js b/src/chatView.js
index 77e3dcc..6cbf99a 100644
--- a/src/chatView.js
+++ b/src/chatView.js
@@ -342,6 +342,12 @@ const ChatView = new Lang.Class({
         if (this._activeNickColor.equal(this._inactiveNickColor))
             this._inactiveNickColor.alpha = 0.5;
 
+        context.save();
+        context.add_class('view');
+        context.set_state(Gtk.StateFlags.NORMAL);
+        this._statusHeaderHoverColor = context.get_color(context.get_state());
+        context.restore();
+
         let buffer = this._view.get_buffer();
         let tagTable = buffer.get_tag_table();
         let tags = [
@@ -868,6 +874,11 @@ const ChatView = new Lang.Class({
                     groupTag.invisible = !groupTag.invisible;
                 });
 
+            headerTag.connect('notify::hover', Lang.bind(this,
+                function() {
+                    headerTag.foreground_rgba = headerTag.hover ? this._statusHeaderHoverColor : null;
+                }));
+
             this._ensureNewLine();
             headerMark = buffer.create_mark('idle-status-start', buffer.get_end_iter(), true);
         } else {


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