[gnome-shell/eos3.8: 107/255] dnd: Include the label when dragging icons, and keep it centered



commit d1a87c701dc98399f6ce3192d9e0c6c70aa049e2
Author: Mario Sanchez Prada <mario endlessm com>
Date:   Fri Jun 30 01:23:40 2017 +0000

    dnd: Include the label when dragging icons, and keep it centered
    
    Currently, we are creating the drag actor using the same method that
    creates the icon for an app/folder, but that does not include the
    label. This patch fixes that by using BaseIcon directly and passing
    the relevant parameters to know how to create the icon and the label.
    
    https://phabricator.endlessm.com/T17661
    https://phabricator.endlessm.com/T18035

 data/theme/gnome-shell-sass/_endless.scss | 12 ++++++++++++
 js/ui/appDisplay.js                       | 15 +++++++++------
 2 files changed, 21 insertions(+), 6 deletions(-)
---
diff --git a/data/theme/gnome-shell-sass/_endless.scss b/data/theme/gnome-shell-sass/_endless.scss
index 69d876aef8..f12f1bdec9 100644
--- a/data/theme/gnome-shell-sass/_endless.scss
+++ b/data/theme/gnome-shell-sass/_endless.scss
@@ -462,6 +462,18 @@ popup-separator-menu-item {
     }
 }
 
+.folder-no-apps-label {
+  text-shadow: black 0px 2px 2px;
+  font-weight: bold;
+  text-align: center;
+  margin-top: 12px;
+  margin-bottom: 12px;
+}
+
+.overview-icon.dnd {
+    @extend %overview-icon;
+}
+
 // Desktop Search (results)
 
 %search-label-main {
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index d972a07c0a..640fba53a0 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1343,8 +1343,15 @@ class ViewIcon extends St.Button {
     }
 
     getDragActor() {
-        // Each subclass creates the actor returned here in different ways
-        throw new Error('Not implemented');
+        let iconParams = {
+            createIcon: this._createIcon.bind(this),
+            showLabel: this.icon.label != null,
+            setSizeManually: false,
+        };
+
+        let icon = new IconGrid.BaseIcon(this.name, iconParams);
+        icon.add_style_class_name('dnd');
+        return icon;
     }
 
     // Returns the original actor that should align with the actor
@@ -2123,10 +2130,6 @@ var AppIcon = GObject.registerClass({
         this.app.open_new_window(params.workspace);
     }
 
-    getDragActor() {
-        return this.app.create_icon_texture(this._iconSize);
-    }
-
     shouldShowTooltip() {
         return this.hover && (!this._menu || !this._menu.isOpen);
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]