[polari] entryArea: Filter out BACKDROP state from nick button



commit b8adca9bf4ab6240766590db1fd25bf57b38418d
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Jul 8 18:49:22 2016 +0200

    entryArea: Filter out BACKDROP state from nick button
    
    We want the button to blend in with the chat log, however when the
    toplevel window doesn't have focus, active nicks in the log keep
    their color, while the nick button (and thus the user's own nick)
    is grayed out and dimmed. Work around this issue by filtering out
    the BACKDROP state altogether.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=768381

 src/entryArea.js |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/src/entryArea.js b/src/entryArea.js
index 4e0c1f7..ce4761c 100644
--- a/src/entryArea.js
+++ b/src/entryArea.js
@@ -136,6 +136,18 @@ const EntryArea = new Lang.Class({
         this._nickLabel.set_state_flags(Gtk.StateFlags.LINK, false);
         this._nickLabel.width_chars = this._maxNickChars;
 
+        /* HACK: We don't want the button to look different when the toplevel
+                 is unfocused, so filter out the BACKDROP state */
+        this._nickButton.connect('state-flags-changed', Lang.bind(this,
+            function(w) {
+                let state = w.get_state_flags();
+                if (!(state & Gtk.StateFlags.BACKDROP))
+                    return; // avoid indefinite recursion
+
+                state &= ~Gtk.StateFlags.BACKDROP;
+                w.set_state_flags (state, true);
+            }));
+
         this._changeButton.connect('clicked', Lang.bind(this,
             function() {
                if (this._nickEntry.text)


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