[gnome-shell] runDialog: animate to new height on error



commit 2905b0318d267b14e5eb251ccfcd8d4ec8c971e8
Author: Ray Strode <rstrode redhat com>
Date:   Mon Dec 6 14:41:45 2010 -0500

    runDialog: animate to new height on error
    
    When an error message is displayed the run dialog
    pops to the new height instantly.  It needs a
    a transition.
    
    This commit makes the dialog quickly grow to its
    ultimate height, making room for the error message,
    before showing it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=637187

 js/ui/runDialog.js |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/runDialog.js b/js/ui/runDialog.js
index f29866d..88c0579 100644
--- a/js/ui/runDialog.js
+++ b/js/ui/runDialog.js
@@ -21,6 +21,8 @@ const MAX_FILE_DELETED_BEFORE_INVALID = 10;
 const HISTORY_KEY = 'command-history';
 const HISTORY_LIMIT = 512;
 
+const DIALOG_GROW_TIME = 0.1;
+
 function CommandCompleter() {
     this._init();
 }
@@ -362,7 +364,21 @@ __proto__: ModalDialog.ModalDialog.prototype,
                     let errorStr = _("Execution of '%s' failed:").format(command) + '\n' + e.message;
                     this._errorMessage.set_text(errorStr);
 
-                    this._errorBox.show();
+                    if (!this._errorBox.visible) {
+                        let [errorBoxMinHeight, errorBoxNaturalHeight] = this._errorBox.get_preferred_height(-1);
+
+                        let parentActor = this._errorBox.get_parent();
+                        Tweener.addTween(parentActor,
+                                         { height: parentActor.height + errorBoxNaturalHeight,
+                                           time: DIALOG_GROW_TIME,
+                                           transition: 'easeOutQuad',
+                                           onComplete: Lang.bind(this,
+                                               function() {
+                                                    parentActor.set_height(-1);
+                                                    this._errorBox.show();
+                                               })
+                                         });
+                    }
                 }
             }
         }



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