[gnome-shell/T27795: 138/138] dnd: Include the label when dragging icons, and keep it centered
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/T27795: 138/138] dnd: Include the label when dragging icons, and keep it centered
- Date: Tue, 1 Oct 2019 23:40:56 +0000 (UTC)
commit 45f963dd454de2ad6b40f89b37883332d286ca4f
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 | 33 ++++++++++++++++++++++++-------
js/ui/appDisplay.js | 11 +++++++++--
2 files changed, 35 insertions(+), 9 deletions(-)
---
diff --git a/data/theme/gnome-shell-sass/_endless.scss b/data/theme/gnome-shell-sass/_endless.scss
index 082e07cad5..ae0990cb67 100644
--- a/data/theme/gnome-shell-sass/_endless.scss
+++ b/data/theme/gnome-shell-sass/_endless.scss
@@ -453,19 +453,40 @@ popup-separator-menu-item {
-arrow-background-color: rgba(0, 0, 0, 0.3);
}
+%overview-icon {
+ width: 118px;
+ height: 118px;
+ icon-size: 64px;
+ spacing: 4px;
+ padding-top: 12px;
+ padding-bottom: 0px;
+ border-radius: 15px;
+ font-weight: bold;
+ text-align: center;
+}
+
.icon-grid {
spacing: 10px;
-shell-grid-horizontal-item-size: 118px;
-shell-grid-vertical-item-size: 118px;
.overview-icon {
- icon-size: 64px;
- spacing: 8px;
- border-radius: 15px;
- font-weight: bold;
+ @extend %overview-icon;
}
}
+.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 (text entry widget)
#searchEntry {
@@ -547,9 +568,7 @@ popup-separator-menu-item {
margin-bottom: 10px;
.overview-icon {
- icon-size: 64px;
- spacing: 8px;
- text-align: center;
+ @extend %overview-icon;
}
.overview-icon-label {
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 0f68ef4014..640b2fabcf 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1395,8 +1395,15 @@ class ViewIcon extends GObject.Object {
}
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]