appIcon: Make AppIcon a drop target
Because the Dash icons are not drop targets themselves, add a tiny DashIcon class, which is an AppDisplay.AppIcon subclass, and disable all DND drop code from it. Show a folder preview when dragging an app icon over another app icon. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/671
This commit is contained in:
@ -24,6 +24,30 @@ function getAppFromSource(source) {
|
||||
}
|
||||
}
|
||||
|
||||
var DashIcon = class DashIcon extends AppDisplay.AppIcon {
|
||||
constructor(app) {
|
||||
super(app, {
|
||||
setSizeManually: true,
|
||||
showLabel: false
|
||||
});
|
||||
}
|
||||
|
||||
// Disable all DnD methods
|
||||
_onDragBegin() {
|
||||
}
|
||||
|
||||
_onDragEnd() {
|
||||
}
|
||||
|
||||
handleDragOver() {
|
||||
return DND.DragMotionResult.CONTINUE;
|
||||
}
|
||||
|
||||
acceptDrop() {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
// A container like StBin, but taking the child's scale into account
|
||||
// when requesting a size
|
||||
var DashItemContainer = GObject.registerClass(
|
||||
@ -450,9 +474,7 @@ var Dash = class Dash {
|
||||
}
|
||||
|
||||
_createAppItem(app) {
|
||||
let appIcon = new AppDisplay.AppIcon(app,
|
||||
{ setSizeManually: true,
|
||||
showLabel: false });
|
||||
let appIcon = new DashIcon(app);
|
||||
|
||||
appIcon.connect('menu-state-changed',
|
||||
(appIcon, opened) => {
|
||||
|
Reference in New Issue
Block a user