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/664
This commit is contained in:
Georges Basile Stavracas Neto 2019-07-01 21:37:35 -03:00
parent ec8b7bc7b2
commit 54a2773046
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; border-image: none;
background-image: none; background-image: none;
} }
&:drop .overview-icon {
background-color: transparentize($selected_bg_color,.15);
}
&:active .overview-icon, &:active .overview-icon,
&:checked .overview-icon { &:checked .overview-icon {
background-color: transparentize(darken($osd_bg_color,10%), 0.5); background-color: transparentize(darken($osd_bg_color,10%), 0.5);

View File

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