[gnome-shell/gbsneto/icon-grid-dnd: 24/35] folderView: Move DnD functions to BaseAppView



commit a8680048d82088abc8c8a0e0c5c7772bbd6fda52
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Tue Jul 2 16:27:18 2019 -0300

    folderView: Move DnD functions to BaseAppView
    
    It will be much easier to handle Drag n' Drop with BaseAppView
    implementing default handlers for it.
    
    Move handleDragOver() and acceptDrop() to BaseAppView.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/603

 js/ui/appDisplay.js | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index bcdef15bb..d4817ccc4 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -167,6 +167,14 @@ class BaseAppView {
             log('No such application ' + id);
     }
 
+    handleDragOver(source, actor, x, y, time) {
+        return DND.DragMotionResult.NO_DROP;
+    }
+
+    acceptDrop(source, actor, x, y, time) {
+        return false;
+    }
+
     selectApp(id) {
         if (this._items[id] && this._items[id].actor.mapped) {
             this._selectAppInternal(id);
@@ -1258,15 +1266,6 @@ var FolderView = class FolderView extends BaseAppView {
         this._offsetForEachSide = offset;
     }
 
-    handleDragOver(source, actor, x, y, time) {
-        return DND.DragMotionResult.NO_DROP;
-    }
-
-    acceptDrop(source, actor, x, y, time) {
-        // Only dropping at the folder icon is accepted
-        return true;
-    }
-
     _loadApps() {
         let apps = [];
         let excludedApps = this._folder.get_strv('excluded-apps');


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