[gnome-shell] search: Ensure that the default result is visible in the scroll view



commit e339e2658df018f531583fea005b6c9e774f048c
Author: Rui Matos <tiagomatos gmail com>
Date:   Thu Mar 20 11:27:05 2014 +0100

    search: Ensure that the default result is visible in the scroll view
    
    The default result is set to selected when key focus enters the search
    entry. We must also scroll the view if needed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=726759

 js/ui/search.js |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/search.js b/js/ui/search.js
index e544497..919642a 100644
--- a/js/ui/search.js
+++ b/js/ui/search.js
@@ -629,8 +629,11 @@ const SearchResults = new Lang.Class({
         if (newDefaultResult != this._defaultResult) {
             if (this._defaultResult)
                 this._defaultResult.setSelected(false);
-            if (newDefaultResult)
+            if (newDefaultResult) {
                 newDefaultResult.setSelected(this._highlightDefault);
+                if (this._highlightDefault)
+                    Util.ensureActorVisibleInScrollView(this._scrollView, newDefaultResult.actor);
+            }
 
             this._defaultResult = newDefaultResult;
         }
@@ -667,8 +670,11 @@ const SearchResults = new Lang.Class({
 
     highlightDefault: function(highlight) {
         this._highlightDefault = highlight;
-        if (this._defaultResult)
+        if (this._defaultResult) {
             this._defaultResult.setSelected(highlight);
+            if (highlight)
+                Util.ensureActorVisibleInScrollView(this._scrollView, this._defaultResult.actor);
+        }
     },
 
     navigateFocus: function(direction) {


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