[gnome-shell/eos3.8: 109/255] Allow dragging folder icons
- From: Matthew Leeds <mwleeds src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/eos3.8: 109/255] Allow dragging folder icons
- Date: Wed, 10 Jun 2020 19:07:08 +0000 (UTC)
commit ad642f469ac10823990cab5913d2ad3f0c5cd455
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Wed Oct 2 22:35:26 2019 -0300
Allow dragging folder icons
js/ui/appDisplay.js | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index e4039b2889..9bbe8cfc87 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -328,9 +328,6 @@ var BaseAppView = GObject.registerClass({
}
_canAccept(source) {
- if (!(source instanceof AppIcon))
- return false;
-
return true;
}
@@ -929,15 +926,12 @@ class AppDisplay extends BaseAppView {
}
_onDragMotion(dragEvent) {
- if (!(dragEvent.source instanceof AppIcon))
- return DND.DragMotionResult.CONTINUE;
-
- let appIcon = dragEvent.source;
+ let icon = dragEvent.source;
// Handle the drag overshoot. When dragging to above the
// icon grid, move to the page above; when dragging below,
// move to the page below.
- if (this._grid.contains(appIcon))
+ if (this._grid.contains(icon))
this._handleDragOvershoot(dragEvent);
if (!this._grid.contains(dragEvent.targetActor))
@@ -1190,6 +1184,13 @@ class FolderView extends BaseAppView {
return icon;
}
+ _canAccept(source) {
+ if (!(source instanceof AppIcon))
+ return false;
+
+ return true;
+ }
+
_onPan(action) {
let [dist_, dx_, dy] = action.get_motion_delta(0);
let adjustment = this._scrollView.vscroll.adjustment;
@@ -1428,7 +1429,7 @@ var FolderIcon = GObject.registerClass({
button_mask: St.ButtonMask.ONE,
toggle_mode: true,
}, {
- isDraggable: false,
+ isDraggable: true,
createIcon: this._createIcon.bind(this),
setSizeManually: false,
});
@@ -1517,7 +1518,7 @@ var FolderIcon = GObject.registerClass({
handleDragOver(source, _actor, x, y) {
if (!this._canAccept(source))
- return DND.DragMotionResult.NO_DROP;
+ return DND.DragMotionResult.CONTINUE;
if (!this._betweenLeeways(x, y))
return DND.DragMotionResult.CONTINUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]