[gnome-shell/gbsneto/icon-grid-dnd: 9/13] folderView: Pass and add getter to folder icon



commit b0d6c22aa457227ca7aa8cf576c00721ae39cf3a
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Sat Jun 29 00:45:09 2019 -0300

    folderView: Pass and add getter to folder icon
    
    We will need to access the folder icon that owns the
    view in order to remove apps from folders.
    
    Add a new parameter to the constructor of FolderView,
    and the corresponding getter, for the FolderIcon that
    owns it.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/602

 js/ui/appDisplay.js | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index cfd5aedd9..d21651c26 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1065,11 +1065,12 @@ var AppSearchProvider = class AppSearchProvider {
 };
 
 var FolderView = class FolderView extends BaseAppView {
-    constructor() {
+    constructor(folderIcon) {
         super(null, null);
         // If it not expand, the parent doesn't take into account its preferred_width when allocating
         // the second time it allocates, so we apply the "Standard hack for ClutterBinLayout"
         this._grid.x_expand = true;
+        this._folderIcon = folderIcon;
 
         this.actor = new St.ScrollView({ overlay_scrollbars: true });
         this.actor.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC);
@@ -1172,6 +1173,10 @@ var FolderView = class FolderView extends BaseAppView {
     setPaddingOffsets(offset) {
         this._offsetForEachSide = offset;
     }
+
+    get folderIcon() {
+        return this._folderIcon;
+    }
 };
 
 var FolderIcon = class FolderIcon {
@@ -1197,7 +1202,7 @@ var FolderIcon = class FolderIcon {
         this.actor.set_child(this.icon);
         this.actor.label_actor = this.icon.label;
 
-        this.view = new FolderView();
+        this.view = new FolderView(this);
 
         Main.overview.connect('item-drag-begin',
                               this._onDragBegin.bind(this));


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