[gnome-shell/gbsneto/folder-dialog-improvements: 8/20] appDisplay: Move adaptToSize call to FolderView
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [gnome-shell/gbsneto/folder-dialog-improvements: 8/20] appDisplay: Move adaptToSize call to FolderView
 
- Date: Tue,  9 Jun 2020 19:16:16 +0000 (UTC)
 
commit c790c01a3b7b2596615753ae9d4d1d7b27527f65
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Thu Jun 4 22:10:04 2020 -0300
    appDisplay: Move adaptToSize call to FolderView
    
    There is absolutely no need to handle this in the dialog
    itself.
    
    Move the call to adaptToSize into FolderView.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1301
 js/ui/appDisplay.js | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index ddb34e0dfd..dad8fdc925 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1097,6 +1097,18 @@ class FolderView extends BaseAppView {
         this._redisplay();
     }
 
+    vfunc_allocate(box) {
+        const node = this.get_theme_node();
+        const contentBox = node.get_content_box(box);
+
+        const [width, height] = contentBox.get_size();
+        this.adaptToSize(width, height);
+
+        this._grid.topPadding = 0;
+
+        super.vfunc_allocate(box);
+    }
+
     _childFocused(actor) {
         Util.ensureActorVisibleInScrollView(this._scrollView, actor);
     }
@@ -1686,18 +1698,6 @@ var AppFolderDialog = GObject.registerClass({
     }
 
     vfunc_allocate(box) {
-        let contentBox = this.get_theme_node().get_content_box(box);
-        contentBox = this._viewBox.get_theme_node().get_content_box(contentBox);
-
-        let [, entryBoxHeight] = this._entryBox.get_size();
-        let spacing = this._viewBox.layout_manager.spacing;
-
-        this._view.adaptToSize(
-            contentBox.get_width(),
-            contentBox.get_height() - entryBoxHeight - spacing);
-
-        this._view._grid.topPadding = 0;
-
         super.vfunc_allocate(box);
 
         // We can only start zooming after receiving an allocation
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]