folderIcon: Add visual drag-over feedback

WIP: This is not exactly what was discussed on IRC, but
it's looking alright as a first iteration. Design feedback
welcomed.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/603
This commit is contained in:
Georges Basile Stavracas Neto 2019-07-01 21:37:35 -03:00
parent 74077b0f6e
commit 52257f5137
No known key found for this signature in database
GPG Key ID: 886C17EE170D1385
2 changed files with 21 additions and 0 deletions

View File

@ -1514,6 +1514,9 @@ StScrollBar {
border-image: none;
background-image: none;
}
&:drop .overview-icon {
background-color: transparentize($selected_bg_color,.15);
}
&:active .overview-icon,
&:checked .overview-icon {
background-color: transparentize(darken($osd_bg_color,10%), 0.5);

View File

@ -1361,11 +1361,29 @@ var FolderIcon = class FolderIcon {
}
_onDragBegin() {
this._dragMonitor = {
dragMotion: this._onDragMotion.bind(this),
};
DND.addDragMonitor(this._dragMonitor);
this._parentView.inhibitEventBlocker();
}
_onDragMotion(dragEvent) {
let target = dragEvent.targetActor;
if (!this.actor.contains(target) || !this._canDropAt(dragEvent.source))
this.actor.remove_style_pseudo_class('drop');
else
this.actor.add_style_pseudo_class('drop');
return DND.DragMotionResult.CONTINUE;
}
_onDragEnd() {
this.actor.remove_style_pseudo_class('drop');
this._parentView.uninhibitEventBlocker();
DND.removeDragMonitor(this._dragMonitor);
}
_canDropAt(source) {