[gnome-shell] viewSelector: While on search results keep the entry styled as focused



commit 203382e0079442fb239d123bf2ee8ea190fbe6b8
Author: Rui Matos <tiagomatos gmail com>
Date:   Mon Feb 27 18:43:59 2012 +0100

    viewSelector: While on search results keep the entry styled as focused
    
    This hints the user that even though keynav focus is on the search
    results, if there's character input it will update the search string.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=663901

 js/ui/viewSelector.js |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js
index 22d95ab..925d430 100644
--- a/js/ui/viewSelector.js
+++ b/js/ui/viewSelector.js
@@ -148,7 +148,7 @@ const SearchTab = new Lang.Class({
 
         this._entry.connect('notify::mapped', Lang.bind(this, this._onMapped));
 
-        global.stage.connect('notify::key-focus', Lang.bind(this, this._updateCursorVisibility));
+        global.stage.connect('notify::key-focus', Lang.bind(this, this._onStageKeyFocusChanged));
 
         this._capturedEventId = 0;
 
@@ -199,9 +199,16 @@ const SearchTab = new Lang.Class({
         this._text.set_selection(0, 0);
     },
 
-    _updateCursorVisibility: function() {
+    _onStageKeyFocusChanged: function() {
         let focus = global.stage.get_key_focus();
         this._text.set_cursor_visible(focus == this._text);
+
+        if (focus != this._entry && focus != this._text) {
+            if (this._searchResults.actor.contains(focus))
+                this._entry.add_style_pseudo_class('focus');
+            else
+                this._entry.remove_style_pseudo_class('focus');
+        }
     },
 
     _onMapped: function() {



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