[gnome-shell] dash: Fix some issues with the label API



commit 983535224e2f54e189974cd5c54e0af1301fe73d
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Aug 22 07:05:21 2012 -0300

    dash: Fix some issues with the label API
    
    Be able to call setLabelText more than once.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=682445

 js/ui/dash.js |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/dash.js b/js/ui/dash.js
index bc98ae3..47f6f4d 100644
--- a/js/ui/dash.js
+++ b/js/ui/dash.js
@@ -124,15 +124,19 @@ const DashItemContainer = new Lang.Class({
     },
 
     setLabelText: function(text) {
-        if (this.label == null)
+        if (this.label == null) {
             this.label = new St.Label({ style_class: 'dash-label'});
+            Main.layoutManager.addChrome(this.label);
+            this.label.hide();
+        }
 
         this.label.set_text(text);
-        Main.layoutManager.addChrome(this.label);
-        this.label.hide();
     },
 
     hideLabel: function () {
+        if (this.label == null)
+            return;
+
         Tweener.addTween(this.label,
                          { opacity: 0,
                            time: DASH_ITEM_LABEL_HIDE_TIME,



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