[sushi] mainwindow: fade out the main window on quit



commit 554eba786d8c753bdd908b722d5005f91406510d
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Apr 27 15:12:11 2011 -0400

    mainwindow: fade out the main window on quit

 src/js/ui/mainWindow.js |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)
---
diff --git a/src/js/ui/mainWindow.js b/src/js/ui/mainWindow.js
index 713e917..06626a3 100644
--- a/src/js/ui/mainWindow.js
+++ b/src/js/ui/mainWindow.js
@@ -103,7 +103,7 @@ MainWindow.prototype = {
 
         if (key == Clutter.KEY_Escape ||
             key == Clutter.KEY_space)
-            this._application.quit();
+            this._fadeOutWindow();
     },
 
     _onButtonPressEvent : function(actor, event) {
@@ -484,6 +484,9 @@ MainWindow.prototype = {
         this._stage.add_actor(this._quitActor);
     },
 
+    /**************************************************************************
+     *********************** Window move/fade helpers *************************
+     **************************************************************************/
     _moveWindow : function() {
         let screen = this._gtkWindow.get_screen();
         let monitor = screen.get_monitor_at_window(this._parent);
@@ -511,6 +514,22 @@ MainWindow.prototype = {
                            transition: 'easeOutQuad' });
     },
 
+    _fadeOutWindow : function() {
+        Tweener.addTween(this._background,
+                         { opacity: 0,
+                           time: 0.15,
+                           transition: 'easeOutQuad' });
+        Tweener.addTween(this._texture,
+                         { opacity: 0,
+                           time: 0.15,
+                           transition: 'easeOutQuad',
+                           onComplete: function () {
+                               this._application.quit();
+                           },
+                           onCompleteScope: this
+                         });
+    },
+
     /**************************************************************************
      ************************ public methods **********************************
      **************************************************************************/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]