From 983535224e2f54e189974cd5c54e0af1301fe73d Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Wed, 22 Aug 2012 07:05:21 -0300 Subject: [PATCH] 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 file changed, 7 insertions(+), 3 deletions(-) diff --git a/js/ui/dash.js b/js/ui/dash.js index bc98ae323..47f6f4d39 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,