dash: Only set the label's text when initially showing the label

Having the tooltip change when it's visible looks strange and glitchy.
This also makes sure that "Remove from Favorites" doesn't change, even
when the user removes their mouse cursor from it.

https://bugzilla.gnome.org/show_bug.cgi?id=685313
This commit is contained in:
Jasper St. Pierre 2012-10-03 02:22:46 -03:00
parent 06e5c25383
commit 6487cd8c6f

View File

@ -48,6 +48,7 @@ const DashItemContainer = new Lang.Class({
Lang.bind(this, this._allocate));
this.actor._delegate = this;
this._labelText = "";
this.label = new St.Label({ style_class: 'dash-label'});
this.label.hide();
Main.layoutManager.addChrome(this.label);
@ -106,6 +107,10 @@ const DashItemContainer = new Lang.Class({
},
showLabel: function() {
if (!this._labelText)
return;
this.label.set_text(this._labelText);
this.label.opacity = 0;
this.label.show();
@ -136,7 +141,7 @@ const DashItemContainer = new Lang.Class({
},
setLabelText: function(text) {
this.label.set_text(text);
this._labelText = text;
},
hideLabel: function () {