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:
parent
74077b0f6e
commit
52257f5137
@ -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);
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user