[gnome-shell/wip/swarm: 10/13] appDisplay: Allow animating appIcon on new window



commit 760b8218d64aafec0ed198c2f390bd9e4de46b62
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 |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index bc69ed1..21b390d 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.icon.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.icon.animateOut();
 
         if (openNewWindow)
             this.app.open_new_window(-1);
@@ -1720,6 +1728,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]