[gnome-shell/app-picker-refresh: 7/15] appDisplay: Make scrolling in AlphabeticalView optional



commit e9e937e121a267cbd07e0298599829b87ac7957c
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Feb 15 16:54:09 2013 +0100

    appDisplay: Make scrolling in AlphabeticalView optional
    
    Folders will reuse AlphabeticalView to display a category, but we
    only want scrolling in the primary view, so add a parameter to
    make scrolling optional.

 js/ui/appDisplay.js |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 5609178..7a5d63c 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -50,7 +50,9 @@ function _loadCategory(dir, view) {
 const AlphabeticalView = new Lang.Class({
     Name: 'AlphabeticalView',
 
-    _init: function() {
+    _init: function(params) {
+        params = Params.parse(params, { scrollable: false });
+
         this._grid = new IconGrid.IconGrid({ xAlign: St.Align.START });
         this._appSystem = Shell.AppSystem.get_default();
 
@@ -63,9 +65,13 @@ const AlphabeticalView = new Lang.Class({
         this.actor = new St.ScrollView({ x_fill: true,
                                          y_fill: false,
                                          y_align: St.Align.START,
+                                         reactive: params.scrollable,
                                          style_class: 'vfade' });
         this.actor.add_actor(box);
-        this.actor.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC);
+        let vPolicy = params.scrollable ? Gtk.PolicyType.AUTOMATIC
+                                        : Gtk.PolicyType.NEVER;
+        this.actor.set_policy(Gtk.PolicyType.NEVER, vPolicy);
+
         let action = new Clutter.PanAction({ interpolate: true });
         action.connect('pan', Lang.bind(this, this._onPan));
         this.actor.add_action(action);
@@ -140,7 +146,7 @@ const AppDisplay = new Lang.Class({
                                   style_class: 'app-display',
                                   x_fill: true, y_fill: true });
 
-        this._view = new AlphabeticalView();
+        this._view = new AlphabeticalView({ scrollable: true });
         box.add(this._view.actor);
 
         // We need a dummy actor to catch the keyboard focus if the


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