[gnome-shell/T27795: 109/138] appDisplay: Consider all grid's ancestors to calculate its available size



commit 72c0e13f66576fb46fc811d4cba9e446e55cecc3
Author: Mario Sanchez Prada <mario endlessm com>
Date:   Tue Jun 20 15:00:03 2017 +0100

    appDisplay: Consider all grid's ancestors to calculate its available size
    
    The current code is accounting for the border and padding of the top
    container and the child scrollview to calculate the grid's content box,
    but there are two more containers in the way that also needed to be
    accounted for, or the result size passed to the icon grid will be too
    big, resulting in the number of pages being miscalculated.
    
    https://phabricator.endlessm.com/T17658

 js/ui/appDisplay.js | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 70076bf43d..20d7e8978f 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -330,14 +330,14 @@ class AllViewContainer extends St.Widget {
         });
 
         this.stack = new St.Widget({ layout_manager: new Clutter.BinLayout() });
-        let box = new St.BoxLayout({ vertical: true });
+        this.stackBox = new St.BoxLayout({ vertical: true });
 
         this.stack.add_child(gridActor);
-        box.add_child(this.stack);
+        this.stackBox.add_child(this.stack);
 
         // For some reason I couldn't investigate yet using add_child()
         // here makes the icon grid not to show up on the desktop.
-        this.scrollView.add_actor(box);
+        this.scrollView.add_actor(this.stackBox);
 
         this.add_child(this.scrollView);
     }
@@ -349,6 +349,7 @@ var AllView = class AllView extends BaseAppView {
         this.actor = new AllViewContainer(this._grid);
         this._scrollView = this.actor.scrollView;
         this._stack = this.actor.stack;
+        this._stackBox = this.actor.stackBox;
         this._grid._delegate = this;
 
         this._adjustment = this._scrollView.vscroll.adjustment;
@@ -734,6 +735,8 @@ var AllView = class AllView extends BaseAppView {
         box.y2 = height;
         box = this.actor.get_theme_node().get_content_box(box);
         box = this._scrollView.get_theme_node().get_content_box(box);
+        box = this._stackBox.get_theme_node().get_content_box(box);
+        box = this._stack.get_theme_node().get_content_box(box);
         box = this._grid.get_theme_node().get_content_box(box);
         let availWidth = box.x2 - box.x1;
         let availHeight = box.y2 - box.y1;


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