[gnome-shell/gbsneto/icon-grid-dnd: 28/37] 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/37] folderView: Move DnD functions to BaseAppView
- Date: Wed, 3 Jul 2019 19:13:46 +0000 (UTC)
commit 23ac5f0bb4ead9097f89b2cfbd54ed3e3d206706
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 6a617d1dd..7cedb382c 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]