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



commit 658586595d0a60692893801a8d9b8e46d8e241f1
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/603

 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 fb6af2aae..92c119cbb 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1049,11 +1049,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);
@@ -1156,6 +1157,10 @@ var FolderView = class FolderView extends BaseAppView {
     setPaddingOffsets(offset) {
         this._offsetForEachSide = offset;
     }
+
+    get folderIcon() {
+        return this._folderIcon;
+    }
 };
 
 var FolderIcon = class FolderIcon {
@@ -1181,7 +1186,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]