[gnome-shell/gbsneto/icon-grid-part3: 3/5] appIcon: Use a real BaseIcon as the drag actor
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gbsneto/icon-grid-part3: 3/5] appIcon: Use a real BaseIcon as the drag actor
- Date: Thu, 8 Aug 2019 00:21:09 +0000 (UTC)
commit f3c6005a801b45b23310a3a387c6b67790941248
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Wed Jul 3 13:29:20 2019 -0300
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/671
js/ui/appDisplay.js | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index b153c9cfcd..1f8bed5b1e 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1958,7 +1958,19 @@ var AppIcon = class AppIcon {
}
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);
+
+ let bin = new St.Bin({ style_class: this.actor.style_class });
+ bin.set_child(icon);
+
+ return bin;
}
// Returns the original actor that should align with the actor
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]