[gnome-shell] authPrompt: fade out message if user starts to type



commit 82ee6aed7f49321726736710f8940c065e1704df
Author: Ray Strode <rstrode redhat com>
Date:   Wed Jul 24 10:53:48 2013 -0400

    authPrompt: fade out message if user starts to type
    
    If there are no messages in the queue and a user starts to
    type then we can safely hide the message label since the
    user has probably already read it.
    
    This fixes a weirdness where "Incorrect Password" messages stay
    around, even as the user types in the new correct password.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=704817

 js/gdm/authPrompt.js |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js
index 3aa3ebf..2ef92e1 100644
--- a/js/gdm/authPrompt.js
+++ b/js/gdm/authPrompt.js
@@ -17,6 +17,8 @@ const DEFAULT_BUTTON_WELL_ICON_SIZE = 24;
 const DEFAULT_BUTTON_WELL_ANIMATION_DELAY = 1.0;
 const DEFAULT_BUTTON_WELL_ANIMATION_TIME = 0.3;
 
+const MESSAGE_FADE_OUT_ANIMATION_TIME = 0.5;
+
 const AuthPromptMode = {
     UNLOCK_ONLY: 0,
     UNLOCK_OR_LOG_IN: 1
@@ -166,6 +168,9 @@ const AuthPrompt = new Lang.Class({
 
         this._entry.clutter_text.connect('text-changed',
                                          Lang.bind(this, function() {
+                                             if (!this._userVerifier.hasPendingMessages)
+                                                 this._fadeOutMessage();
+
                                              this._updateNextButtonSensitivity(this._entry.text.length > 0);
                                          }));
         this._entry.clutter_text.connect('activate', Lang.bind(this, function() {
@@ -331,8 +336,20 @@ const AuthPrompt = new Lang.Class({
         return text;
     },
 
+    _fadeOutMessage: function() {
+        if (this._message.opacity == 0)
+            return;
+        Tweener.removeTweens(this._message);
+        Tweener.addTween(this._message,
+                         { opacity: 0,
+                           time: MESSAGE_FADE_OUT_ANIMATION_TIME,
+                           transition: 'easeOutQuad'
+                         });
+    },
+
     setMessage: function(message, styleClass) {
         if (message) {
+            Tweener.removeTweens(this._message);
             this._message.text = message;
             this._message.styleClass = styleClass;
             this._message.opacity = 255;


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