[gnome-shell] appDisplay: make the categories list scrollable, if necessary



commit 6d5e414863bae8abe7bf62c7ae227c2353bd57aa
Author: Dan Winship <danw gnome org>
Date:   Tue Jun 14 16:02:36 2011 -0400

    appDisplay: make the categories list scrollable, if necessary
    
    https://bugzilla.gnome.org/show_bug.cgi?id=651082

 js/ui/appDisplay.js |   16 +++++-----------
 1 files changed, 5 insertions(+), 11 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index c08e956..5f38de3 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -172,10 +172,12 @@ ViewByCategories.prototype = {
         // (used only before the actor is mapped the first time)
         this._currentCategory = -2;
         this._filters = new St.BoxLayout({ vertical: true, reactive: true });
-        this._filters.connect('scroll-event', Lang.bind(this, this._scrollFilter));
-
+        this._filtersBox = new St.ScrollView({ x_fill: false,
+                                               y_fill: false,
+                                               style_class: 'vfade' });
+        this._filtersBox.add_actor(this._filters);
         this.actor.add(this._view.actor, { expand: true, x_fill: true, y_fill: true });
-        this.actor.add(this._filters, { expand: false, y_fill: false, y_align: St.Align.START });
+        this.actor.add(this._filtersBox, { expand: false, y_fill: false, y_align: St.Align.START });
 
         // Always select the "All" filter when switching to the app view
         this.actor.connect('notify::mapped', Lang.bind(this,
@@ -193,14 +195,6 @@ ViewByCategories.prototype = {
         this.actor.add(this._focusDummy);
     },
 
-    _scrollFilter: function(actor, event) {
-        let direction = event.get_scroll_direction();
-        if (direction == Clutter.ScrollDirection.UP)
-            this._selectCategory(Math.max(this._currentCategory - 1, -1))
-        else if (direction == Clutter.ScrollDirection.DOWN)
-            this._selectCategory(Math.min(this._currentCategory + 1, this._sections.length - 1));
-    },
-
     _selectCategory: function(num) {
         if (this._currentCategory == num) // nothing to do
             return;



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