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



commit e3b36b9c51c09b759d06a032480e7a24ebfcac12
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.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=694192

 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 456feb5..3273e0f 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._appIcons = {}; // desktop file id
@@ -62,9 +64,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);
@@ -139,7 +145,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]