[gnome-shell/gbsneto/folders-as-dialogs: 4/9] appDisplay: Cleanup unnecessary code



commit 71a6f64dc02280c81cea684569699edf12e4b577
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Thu Dec 12 16:07:37 2019 -0300

    appDisplay: Cleanup unnecessary code
    
    Now that the folder dialog handles the adaptToSize workaround,
    there is no need to propagate the call throughout the class
    hierarchy.
    
    Remove the propagating calls to adaptToSize, and all the satellite
    code.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/896

 js/ui/appDisplay.js | 55 +----------------------------------------------------
 1 file changed, 1 insertion(+), 54 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index d69db0727a..ca071482c6 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -579,10 +579,6 @@ var AllView = GObject.registerClass({
             this._pageIndicators.animateIndicators(animationDirection);
     }
 
-    getCurrentPageY() {
-        return this._grid.getPageY(this._grid.currentPage);
-    }
-
     goToPage(pageNumber, animate = true) {
         pageNumber = clamp(pageNumber, 0, this._grid.nPages() - 1);
 
@@ -786,9 +782,6 @@ var AllView = GObject.registerClass({
 
         this._availWidth = availWidth;
         this._availHeight = availHeight;
-        // Update folder views
-        for (let i = 0; i < this._folderIcons.length; i++)
-            this._folderIcons[i].adaptToSize(availWidth, availHeight);
     }
 
     _resetOvershoot() {
@@ -1412,36 +1405,6 @@ class FolderView extends BaseAppView {
         this._grid.bottomPadding = Math.max(this._grid.bottomPadding, 0);
         this._grid.leftPadding = Math.max(this._grid.leftPadding, 0);
         this._grid.rightPadding = Math.max(this._grid.rightPadding, 0);
-
-        this.set_width(this.usedWidth());
-        this.set_height(this.usedHeight());
-    }
-
-    _getPageAvailableSize() {
-        let pageBox = new Clutter.ActorBox();
-        pageBox.x1 = pageBox.y1 = 0;
-        pageBox.x2 = this._parentAvailableWidth;
-        pageBox.y2 = this._parentAvailableHeight;
-
-        let contentBox = this.get_theme_node().get_content_box(pageBox);
-        // We only can show icons inside the collection view boxPointer
-        // so we have to subtract the required padding etc of the boxpointer
-        return [contentBox.x2 - contentBox.x1, contentBox.y2 - contentBox.y1];
-    }
-
-    usedWidth() {
-        let [availWidthPerPage] = this._getPageAvailableSize();
-        return this._grid.usedWidth(availWidthPerPage);
-    }
-
-    usedHeight() {
-        return this._grid.usedHeightForNRows(this.nRowsDisplayedAtOnce());
-    }
-
-    nRowsDisplayedAtOnce() {
-        let [availWidthPerPage, availHeightPerPage] = this._getPageAvailableSize();
-        let maxRows = this._grid.rowsForHeight(availHeightPerPage) - 1;
-        return Math.min(this._grid.nRows(availWidthPerPage), maxRows);
     }
 
     _loadApps() {
@@ -1540,8 +1503,6 @@ var FolderIcon = GObject.registerClass({
         this._folder = new Gio.Settings({ schema_id: 'org.gnome.desktop.app-folders.folder',
                                           path });
         this._delegate = this;
-        // whether we need to update arrow side, position etc.
-        this._dialogInvalidated = false;
 
         this.icon = new IconGrid.BaseIcon('', {
             createIcon: this._createIcon.bind(this),
@@ -1693,13 +1654,8 @@ var FolderIcon = GObject.registerClass({
         return this.view.createFolderIcon(iconSize, this);
     }
 
-    _popupHeight() {
-        let usedHeight = this.view.usedHeight();
-        return usedHeight;
-    }
-
     _ensureFolderDialog() {
-        if (this._dialog && !this._dialogInvalidated)
+        if (this._dialog)
             return;
         if (!this._dialog) {
             this._dialog = new AppFolderDialog(this);
@@ -1709,7 +1665,6 @@ var FolderIcon = GObject.registerClass({
                     this.checked = false;
             });
         }
-        this._dialogInvalidated = false;
     }
 
     _removeMenuTimeout() {
@@ -1784,14 +1739,6 @@ var FolderIcon = GObject.registerClass({
         this._menu.open();
         this._menuManager.ignoreRelease();
     }
-
-    adaptToSize(width, height) {
-        this._parentAvailableWidth = width;
-        this._parentAvailableHeight = height;
-        if (this._dialog)
-            this.view.adaptToSize(width, height);
-        this._dialogInvalidated = true;
-    }
 });
 
 var RenameFolderMenuItem = GObject.registerClass(


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