[gnome-shell/app-picker-refresh: 3/16] appDisplay: Merge AllAppDisplay and ViewByCategories



commit 707b2dddcf17c7058fa7de9ce0b8e4a562c6b04e
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Jan 30 23:58:42 2013 +0100

    appDisplay: Merge AllAppDisplay and ViewByCategories
    
    With categories removed, the separation between AllAppDisplay and
    ViewByCategories no longer makes sense. Also use this opportunity
    to rename the outdated AllAppDisplay to AppDisplay; it will
    eventually be used to manage different views.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=694192

 data/theme/gnome-shell.css |    4 +-
 js/ui/appDisplay.js        |   45 ++++++++++++++-----------------------------
 js/ui/viewSelector.js      |    2 +-
 3 files changed, 18 insertions(+), 33 deletions(-)
---
diff --git a/data/theme/gnome-shell.css b/data/theme/gnome-shell.css
index cb4f23a..41f9965 100644
--- a/data/theme/gnome-shell.css
+++ b/data/theme/gnome-shell.css
@@ -847,12 +847,12 @@ StScrollBar StButton#vhandle:active {
     icon-size: 96px;
 }
 
-.all-app {
+.app-display {
     padding: 0px 16px 32px 32px;
     spacing: 20px;
 }
 
-.all-app:rtl {
+.app-display:rtl {
     padding-left: 16px;
     padding-right: 32px;
 }
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index e5388a4..587e2b5 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -108,22 +108,30 @@ const AlphabeticalView = new Lang.Class({
     }
 });
 
-const ViewByCategories = new Lang.Class({
-    Name: 'ViewByCategories',
+const AppDisplay = new Lang.Class({
+    Name: 'AppDisplay',
 
     _init: function() {
         this._appSystem = Shell.AppSystem.get_default();
-        this.actor = new St.BoxLayout({ style_class: 'all-app' });
-        this.actor._delegate = this;
+        this._appSystem.connect('installed-changed', Lang.bind(this, function() {
+            Main.queueDeferredWork(this._workId);
+        }));
+
+        let box = new St.BoxLayout();
+        this.actor = new St.Bin({ child: box,
+                                  style_class: 'app-display',
+                                  x_fill: true, y_fill: true });
 
         this._view = new AlphabeticalView();
-        this.actor.add(this._view.actor, { expand: true, x_fill: true, y_fill: true });
+        box.add(this._view.actor);
 
         // We need a dummy actor to catch the keyboard focus if the
         // user Ctrl-Alt-Tabs here before the deferred work creates
         // our real contents
         this._focusDummy = new St.Bin({ can_focus: true });
-        this.actor.add(this._focusDummy);
+        box.add(this._focusDummy);
+
+        this._workId = Main.initializeDeferredWork(this.actor, Lang.bind(this, this._redisplay));
     },
 
     // Recursively load a GMenuTreeDirectory; we could put this in ShellAppSystem too
@@ -148,7 +156,7 @@ const ViewByCategories = new Lang.Class({
         this._view.removeAll();
     },
 
-    refresh: function() {
+    _redisplay: function() {
         this._removeAll();
 
         var tree = this._appSystem.get_tree();
@@ -176,29 +184,6 @@ const ViewByCategories = new Lang.Class({
     }
 });
 
-/* This class represents a display containing a collection of application items.
- * The applications are sorted based on their name.
- */
-const AllAppDisplay = new Lang.Class({
-    Name: 'AllAppDisplay',
-
-    _init: function() {
-        this._appSystem = Shell.AppSystem.get_default();
-        this._appSystem.connect('installed-changed', Lang.bind(this, function() {
-            Main.queueDeferredWork(this._workId);
-        }));
-
-        this._appView = new ViewByCategories();
-        this.actor = new St.Bin({ child: this._appView.actor, x_fill: true, y_fill: true });
-
-        this._workId = Main.initializeDeferredWork(this.actor, Lang.bind(this, this._redisplay));
-    },
-
-    _redisplay: function() {
-        this._appView.refresh();
-    }
-});
-
 const AppSearchProvider = new Lang.Class({
     Name: 'AppSearchProvider',
 
diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js
index 85f4a6c..4e1f1df 100644
--- a/js/ui/viewSelector.js
+++ b/js/ui/viewSelector.js
@@ -96,7 +96,7 @@ const ViewSelector = new Lang.Class({
         this._workspacesPage = this._addPage(this._workspacesDisplay.actor,
                                              _("Windows"), 'emblem-documents-symbolic');
 
-        this._appDisplay = new AppDisplay.AllAppDisplay();
+        this._appDisplay = new AppDisplay.AppDisplay();
         this._appsPage = this._addPage(this._appDisplay.actor,
                                        _("Applications"), 'view-grid-symbolic');
 


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