[gnome-shell/gbsneto/appdisplay-cleanups] appDisplay: Reorganize AppDisplay actor hierarchy



commit 0d16ed9885f40a5b9da20e134b7e7cbd787ac22a
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Wed Dec 11 15:07:16 2019 -0300

    appDisplay: Reorganize AppDisplay actor hierarchy
    
    Right now, the actor hierarchy is such that the scroll view
    does not contain the actual grid. It looks as follows:
    
                  StScrollView
                        ↓
                   StBoxLayout
                        ↓
                    ShellStack
                    ↓        ↓
       PaginatedIconGrid     StWidget
    
    This hierarchy can be slightly reorganized by changing it to be as
    follows:
    
                 StStack
                 ↓     ↓
       StScrollView   StWidget
            ↓
       StBoxLayout
            ↓
     PaginatedIconGrid
    
    This will simplify future work where the PaginatedIconGrid will be
    an implementation of StScrollable, in which case we'll be able to
    simply remove the StBoxLayout from there.

 js/ui/appDisplay.js | 44 +++++++++++++++++++++++++-------------------
 1 file changed, 25 insertions(+), 19 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 7dc9634394..99c052b793 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -341,14 +341,37 @@ var AllView = GObject.registerClass({
             use_pagination: true,
         });
 
+        this._grid._delegate = this;
+
+        this._stack = new St.Widget({
+            layout_manager: new Clutter.BinLayout(),
+            x_expand: true,
+            y_expand: true,
+        });
+        this.add_actor(this._stack);
+
+        let box = new St.BoxLayout({
+            vertical: true,
+            y_align: Clutter.ActorAlign.START,
+        });
+        box.add_child(this._grid);
+
         this._scrollView = new St.ScrollView({
             style_class: 'all-apps',
             x_expand: true,
             y_expand: true,
             reactive: true,
         });
-        this.add_actor(this._scrollView);
-        this._grid._delegate = this;
+        this._scrollView.add_actor(box);
+        this._stack.add_actor(this._scrollView);
+
+        this._eventBlocker = new St.Widget({
+            x_expand: true,
+            y_expand: true,
+            reactive: true,
+            visible: false,
+        });
+        this._stack.add_actor(this._eventBlocker);
 
         this._scrollView.set_policy(St.PolicyType.NEVER,
                                     St.PolicyType.EXTERNAL);
@@ -369,24 +392,7 @@ var AllView = GObject.registerClass({
 
         this._folderIcons = [];
 
-        this._stack = new St.Widget({ layout_manager: new Clutter.BinLayout() });
-        let box = new St.BoxLayout({
-            vertical: true,
-            y_align: Clutter.ActorAlign.START,
-        });
-
         this._grid.currentPage = 0;
-        this._stack.add_actor(this._grid);
-        this._eventBlocker = new St.Widget({
-            x_expand: true,
-            y_expand: true,
-            reactive: true,
-            visible: false,
-        });
-        this._stack.add_actor(this._eventBlocker);
-
-        box.add_actor(this._stack);
-        this._scrollView.add_actor(box);
 
         this._scrollView.connect('scroll-event', this._onScroll.bind(this));
 


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