Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom toolbar #3

Closed
simurai opened this issue Dec 24, 2014 · 6 comments
Closed

Custom toolbar #3

simurai opened this issue Dec 24, 2014 · 6 comments

Comments

@simurai
Copy link
Contributor

simurai commented Dec 24, 2014

I really like this package, but I guess not how it was initially intended. 😉

I don't really want other packages to fill up my toolbar because I might not need/want some of the icons. But what's really great about this package is that I can just configure the icons and actions myself in Menu > Open Your Init Script.

So maybe you could:

  • add a toggle in the settings to block other packages to automatically add icons.
  • mention in the README that it's possible to customize the toolbar in the init script. Maybe it's obvious to other people, but I only discovered it when I tried this package the second time.
@suda
Copy link
Collaborator

suda commented Dec 25, 2014

Hi Simon,

I want to change API so every package which wants to add a toolbar icons, would receive handler to manage its buttons during lifetime. Such registering could be blocked by user from settings.

Adding custom icons from init script sounds like something which can be done in separate package which may be developed by someone other than me wink, wink

@brpaz
Copy link

brpaz commented Jan 25, 2015

"But what's really great about this package is that I can just configure the icons and actions myself in Menu > Open Your Init Script."
@simurai can you show an example of how to configure your menu in the init script?

@simurai
Copy link
Contributor Author

simurai commented Jan 25, 2015

@brpaz Sure, this should add a couple icons that do some stuff.

atom.packages.activatePackage('toolbar')
  .then (pkg) =>
    @toolbar = pkg.mainModule

    @toolbar.appendButton 'octoface', 'open-on-github:history', 'Open on GitHub'
    @toolbar.appendSpacer()
    @toolbar.appendButton 'color-mode', 'theme-toggler:toggle', 'Toggle Themes'
    @toolbar.appendButton 'paintcan', 'styleguide:show', 'Styleguide'
    @toolbar.appendSpacer()
    @toolbar.appendButton 'three-bars', 'tree-view:toggle', 'Toggle tree-view'
    @toolbar.appendSpacer()
    @toolbar.appendButton 'gear', 'settings-view:open', 'Settings'

Note that you need to have some of the packages installed. And the first one, "open-on-github" doesn't seem to work. I guess it's because when you click the button, it already lost focus and doesn't know which file to open. But yeah.. you can add any command that has no "focus issue". It's basically clicking buttons instead of having to remember the shortcuts.

@brpaz
Copy link

brpaz commented Jan 25, 2015

@simurai thanks. I found the answer myself some minutes ago :)
Great package btw.

@jerone
Copy link
Contributor

jerone commented May 23, 2015

simurai commented on 25 jan. 2015 14:18 CET:

atom.packages.activatePackage('toolbar')
  .then (pkg) =>
    @toolbar = pkg.mainModule

    ...

Above code is the old way. The new way is described in the readme.

@jerone
Copy link
Contributor

jerone commented May 26, 2015

I'm closing this issue in favor of #49

@jerone jerone closed this as completed May 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants