window-list: Fade out drag source during drag

During a drag operation, the focus is on the where to drop the dragged
item, not to identify it or its origin.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/338>
This commit is contained in:
Florian Müllner
2024-10-03 17:05:42 +02:00
committed by Marge Bot
parent a725361fc9
commit 9b34ac1eea
+16 -2
View File
@@ -28,6 +28,9 @@ const DND_ACTIVATE_TIMEOUT = 500;
const MIN_DRAG_UPDATE_INTERVAL = 500 * GLib.TIME_SPAN_MILLISECOND;
const DRAG_OPACITY = 0.3;
const DRAG_FADE_DURATION = 200;
const GroupingMode = {
NEVER: 0,
AUTO: 1,
@@ -1073,9 +1076,20 @@ class WindowList extends St.Widget {
this._settings.bind('display-all-workspaces',
button, 'ignore-workspace', Gio.SettingsBindFlags.GET);
button.connect('drag-begin',
() => this._monitorItemDrag());
button.connect('drag-begin', () => {
button.ease({
opacity: 255 * DRAG_OPACITY,
duration: DRAG_FADE_DURATION,
});
this._monitorItemDrag();
});
button.connect('drag-end', () => {
button.ease({
opacity: 255,
duration: DRAG_FADE_DURATION,
});
this._stopMonitoringItemDrag();
this._clearDragPlaceholder();
});