appIcon: Use a real BaseIcon as the drag actor

Moving an app icon to other positions is semantically different
to dragging an actor to the dash; the act of moving should itself
be semantic, in that we should feel like we are moving the actual
icon.

Currently, AppIcon gives the DnD code a simplified version of itself,
with just its icon, instead of a complete copy with the label.

Make AppIcon create a new IconGrid.BaseIcon and use it as the drag
actor.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/603
This commit is contained in:
Georges Basile Stavracas Neto 2019-07-03 13:29:20 -03:00
parent 0bdcf2958f
commit 0596848c27
No known key found for this signature in database
GPG Key ID: 886C17EE170D1385

View File

@ -2123,7 +2123,12 @@ var AppIcon = class AppIcon {
} }
getDragActor() { getDragActor() {
return this.app.create_icon_texture(Main.overview.dashIconSize); let iconParams = { createIcon: this._createIcon.bind(this),
showLabel: (this.icon.label != null),
setSizeManually: true };
let icon = new IconGrid.BaseIcon(this.name, iconParams);
icon.setIconSize(this.icon.iconSize);
return icon;
} }
// Returns the original actor that should align with the actor // Returns the original actor that should align with the actor