[gnome-shell/gbsneto/icon-grid-dnd: 4/13] appIcon: Always pass parent view
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gbsneto/icon-grid-dnd: 4/13] appIcon: Always pass parent view
- Date: Sat, 29 Jun 2019 04:52:27 +0000 (UTC)
commit 60c8e8e1132b49981af4de0a82e906f7287da48c
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Fri Jun 28 21:11:10 2019 -0300
appIcon: Always pass parent view
We will soon need to know which view this icon belongs to,
so add an extra parameter to the constructor to store the
parent view.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/603
js/ui/appDisplay.js | 15 ++++++++++-----
js/ui/dash.js | 2 +-
2 files changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index e3f7e9029..b1aeafa93 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -407,7 +407,7 @@ var AllView = class AllView extends BaseAppView {
apps.forEach(appId => {
let app = appSys.lookup_app(appId);
- let icon = new AppIcon(app,
+ let icon = new AppIcon(app, this,
{ isDraggable: favoritesWritable });
this.addItem(icon);
});
@@ -712,7 +712,7 @@ var FrequentView = class FrequentView extends BaseAppView {
for (let i = 0; i < mostUsed.length; i++) {
if (!mostUsed[i].get_app_info().should_show())
continue;
- let appIcon = new AppIcon(mostUsed[i],
+ let appIcon = new AppIcon(mostUsed[i], this,
{ isDraggable: favoritesWritable });
this._grid.addItem(appIcon, -1);
}
@@ -1001,7 +1001,7 @@ var AppSearchProvider = class AppSearchProvider {
createResultObject(resultMeta) {
if (resultMeta.id.endsWith('.desktop'))
- return new AppIcon(this._appSys.lookup_app(resultMeta['id']));
+ return new AppIcon(this._appSys.lookup_app(resultMeta['id']), null);
else
return new SystemActionIcon(this, resultMeta);
}
@@ -1234,7 +1234,7 @@ var FolderIcon = class FolderIcon {
if (!app.get_app_info().should_show())
return;
- let icon = new AppIcon(app);
+ let icon = new AppIcon(app, this.view);
this.view.addItem(icon);
};
@@ -1491,10 +1491,11 @@ var AppFolderPopup = class AppFolderPopup {
Signals.addSignalMethods(AppFolderPopup.prototype);
var AppIcon = class AppIcon {
- constructor(app, iconParams) {
+ constructor(app, parentView, iconParams) {
this.app = app;
this.id = app.get_id();
this.name = app.get_name();
+ this._parentView = parentView;
this.actor = new St.Button({ style_class: 'app-well-app',
reactive: true,
@@ -1729,6 +1730,10 @@ var AppIcon = class AppIcon {
shouldShowTooltip() {
return this.actor.hover && (!this._menu || !this._menu.isOpen);
}
+
+ get parentView() {
+ return this._parentView;
+ }
};
Signals.addSignalMethods(AppIcon.prototype);
diff --git a/js/ui/dash.js b/js/ui/dash.js
index 0032c912e..29c5256ae 100644
--- a/js/ui/dash.js
+++ b/js/ui/dash.js
@@ -474,7 +474,7 @@ var Dash = class Dash {
}
_createAppItem(app) {
- let appIcon = new AppDisplay.AppIcon(app,
+ let appIcon = new AppDisplay.AppIcon(app, null,
{ setSizeManually: true,
showLabel: false });
if (appIcon._draggable) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]