Skip to content

Commit

Permalink
Use clearer control flow
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-g committed Oct 31, 2018
1 parent 7c4ee44 commit a024acc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions argos@pew.worldwidemann.com/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,12 @@ var ArgosButton = new Lang.Class({

this.actor.visible = buttonLines.length > 0 || !dropdownMode;

if (buttonLines.length === 0 && !dropdownMode) {
this._lineView.setMarkup(GLib.markup_escape_text(this._file.get_basename(), -1));
}
if (!this.actor.visible)
return;

if (buttonLines.length === 1) {
if (buttonLines.length === 0) {
this._lineView.setMarkup(GLib.markup_escape_text(this._file.get_basename(), -1));
} else if (buttonLines.length === 1) {
this._lineView.setLine(buttonLines[0]);
} else if (buttonLines.length > 1) {
this._lineView.setLine(buttonLines[0]);
Expand Down

0 comments on commit a024acc

Please sign in to comment.