[polari/gnome-3-18] Roomlist: Highlight the room row which the popup connects to



commit dab17e193da101e5789ea497cd60f4f5d3084ac2
Author: belinhacbr <belinhacbr gmail com>
Date:   Thu Oct 22 19:12:10 2015 -0200

    Roomlist: Highlight the room row which the popup connects to
    
    Should be visually clear what room the opened popup is connected to.
    
    This fix highlights the room which the popup belongs to.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756325

 data/resources/application.css |    8 ++++++++
 src/roomList.js                |    8 ++++++++
 2 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/data/resources/application.css b/data/resources/application.css
index a4793c4..48cc999 100644
--- a/data/resources/application.css
+++ b/data/resources/application.css
@@ -72,6 +72,14 @@
     color: @theme_selected_fg_color;
 }
 
+.polari-room-list .list-row.has-open-popup {
+    background-color: @polari_dark_bg_color;
+}
+
+.polari-room-list .list-row.has-open-popup:selected {
+    background-color: @theme_selected_bg_color;
+}
+
 .polari-room-list .list-row .pending-messages-count {
     color: @theme_selected_fg_color;
     background-color: mix(@theme_selected_bg_color, @theme_selected_fg_color, 0.3);
diff --git a/src/roomList.js b/src/roomList.js
index 5035b41..d39034f 100644
--- a/src/roomList.js
+++ b/src/roomList.js
@@ -24,6 +24,14 @@ const RoomRow = new Lang.Class({
                     'app.leave-room(("%s", ""))'.format(this.widget.room.id));
 
         this._popover = Gtk.Popover.new_from_model(this.widget, menu);
+        this._popover.connect('notify::visible', Lang.bind(this,
+            function() {
+                let roomContext = this.widget.get_style_context();
+                if (this._popover.visible)
+                    roomContext.add_class('has-open-popup');
+                else
+                    roomContext.remove_class('has-open-popup');
+            }));
         this._popover.position = Gtk.PositionType.BOTTOM;
         this._eventBox.connect('button-release-event',
                             Lang.bind(this, this._onButtonRelease));


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