Refactor show()/hide() sequences
We seem to have a lot of code that does something along the lines of: if (condition) actor.show(); else actor.hide(); ClutterActor already has such a thing for exactly this purpose: the 'visible' property. Use it instead of the mess above. https://bugzilla.gnome.org/show_bug.cgi?id=672272
This commit is contained in:
@ -106,10 +106,7 @@ const Indicator = new Lang.Class({
|
||||
/* TRANSLATORS: this means that bluetooth was disabled by hardware rfkill */
|
||||
this._killswitch.setStatus(_("hardware disabled"));
|
||||
|
||||
if (has_adapter)
|
||||
this.actor.show();
|
||||
else
|
||||
this.actor.hide();
|
||||
this.actor.visible = has_adapter;
|
||||
|
||||
if (on) {
|
||||
this._discoverable.actor.show();
|
||||
|
Reference in New Issue
Block a user