[gnome-shell/wip/swarm: 2/5] appDisplay: Allow animating appIcon on new window
- From: Carlos Soriano <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/swarm: 2/5] appDisplay: Allow animating appIcon on new window
- Date: Thu, 26 Jun 2014 20:06:29 +0000 (UTC)
commit fca82c5b46decbf6b16692ccfc609f5f3a9d679b
Author: Carlos Soriano <carlos soriano89 gmail com>
Date: Thu Jun 26 21:30:44 2014 +0200
appDisplay: Allow animating appIcon on new window
js/ui/appDisplay.js | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index bc69ed1..29f6839 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1456,10 +1456,11 @@ Signals.addSignalMethods(AppFolderPopup.prototype);
const AppIcon = new Lang.Class({
Name: 'AppIcon',
- _init : function(app, iconParams) {
+ _init : function(app, iconParams, params) {
this.app = app;
this.id = app.get_id();
this.name = app.get_name();
+ this.params = Params.parse(params, { animateOnNewWindow: false });
this.actor = new St.Button({ style_class: 'app-well-app',
reactive: true,
@@ -1556,6 +1557,10 @@ const AppIcon = new Lang.Class({
_onClicked: function(actor, button) {
this._removeMenuTimeout();
+ if (this.params.animateOnNewWindow &&
+ this.app.state == Shell.AppState.STOPPED)
+ this.animateOut();
+
if (button == 1) {
this.activate();
} else if (button == 2) {
@@ -1624,6 +1629,9 @@ const AppIcon = new Lang.Class({
let openNewWindow = modifiers & Clutter.ModifierType.CONTROL_MASK &&
this.app.state == Shell.AppState.RUNNING;
+ if (this.params.animateOnNewWindow &&
+ this.app.state == Shell.AppState.STOPPED)
+ this.animateOut();
if (openNewWindow)
this.app.open_new_window(-1);
@@ -1633,6 +1641,10 @@ const AppIcon = new Lang.Class({
Main.overview.hide();
},
+ animateOut: function() {
+ this.icon.animateOut();
+ },
+
shellWorkspaceLaunch : function(params) {
params = Params.parse(params, { workspace: -1,
timestamp: 0 });
@@ -1720,6 +1732,10 @@ const AppIconMenu = new Lang.Class({
this._newWindowMenuItem = this._appendMenuItem(_("New Window"));
this._newWindowMenuItem.connect('activate', Lang.bind(this, function() {
+ if (this._source.params.animateOnNewWindow &&
+ this._source.app.state == Shell.AppState.STOPPED)
+ this._source.animateOut();
+
this._source.app.open_new_window(-1);
this.emit('activate-window', null);
}));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]