Skip to content

Commit

Permalink
desktop: add new shortcut keys for showing/hiding the userbar
Browse files Browse the repository at this point in the history
  • Loading branch information
evanlucas committed Mar 31, 2016
1 parent c627100 commit c7c8c8d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
12 changes: 12 additions & 0 deletions desktop.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,18 @@ Desktop.prototype.setupMenu = function setupMenu() {
this.panels.previousPanel()
}
}
, { label: 'Show Userbar'
, accelerator: 'CommandOrControl+Alt+Left'
, click: () => {
this.panels.showUserbar()
}
}
, { label: 'Hide Userbar'
, accelerator: 'CommandOrControl+Alt+Right'
, click: () => {
this.panels.hideUserbar()
}
}
]
}
]
Expand Down
14 changes: 14 additions & 0 deletions lib/panels.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,18 @@ module.exports = class Panels {
}
}
}

showUserbar() {
if (this.app.settings.get('userbar.hidden')) {
this.app.settings.set('userbar.hidden', false)
this.app.needsLayout()
}
}

hideUserbar() {
if (!this.app.settings.get('userbar.hidden')) {
this.app.settings.set('userbar.hidden', true)
this.app.needsLayout()
}
}
}

0 comments on commit c7c8c8d

Please sign in to comment.