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



commit fa62642363e8da469a01215c53a434163bebc02c
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 61141d8..fa69008 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1470,10 +1470,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,
@@ -1570,6 +1571,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) {
@@ -1638,6 +1643,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);
@@ -1647,6 +1655,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 });
@@ -1734,6 +1746,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]