[gnome-shell/gbsneto/icon-grid-dnd: 28/41] folderView: Move DnD functions to BaseAppView
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gbsneto/icon-grid-dnd: 28/41] folderView: Move DnD functions to BaseAppView
- Date: Thu, 4 Jul 2019 22:28:23 +0000 (UTC)
commit 62d1d19c9206b720b1eb7798ae862c2561ca3b2e
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]