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:
parent
ec8b7bc7b2
commit
54a2773046
@ -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);
|
||||
|
@ -1377,11 +1377,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._canAccept(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);
|
||||
}
|
||||
|
||||
_canAccept(source) {
|
||||
|
Loading…
Reference in New Issue
Block a user