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:
Jasper St. Pierre
2012-03-16 18:53:14 -04:00
parent e333263fd6
commit 723a1c843a
7 changed files with 19 additions and 74 deletions

View File

@ -844,10 +844,7 @@ const WorkspacesDisplay = new Lang.Class({
if (!primaryView)
return;
primaryView.actor.opacity = opacity;
if (opacity == 0)
primaryView.actor.hide();
else
primaryView.actor.show();
primaryView.actor.visible = opacity != 0;
}));
}));
},