All Projects → atom-community → tool-bar

atom-community / tool-bar

Licence: MIT license
Package providing customisable toolbar for Atom

Programming Languages

CSS
56736 projects
javascript
184084 projects - #8 most used programming language
Less
1899 projects

Projects that are alternatives of or similar to tool-bar

Tool Bar
Package providing customisable toolbar for Atom
Stars: ✭ 159 (-1.24%)
Mutual labels:  atom, toolbar
atom-toolbar-almighty
Atom editor's missing toolbar
Stars: ✭ 21 (-86.96%)
Mutual labels:  atom, toolbar
quick-query
Do queries against your local databases
Stars: ✭ 65 (-59.63%)
Mutual labels:  atom
Whatsapp Android App
This is sample code for layout for chatting app like Whatsapp.
Stars: ✭ 32 (-80.12%)
Mutual labels:  toolbar
OpcacheBundle
Displays the PHP OPcache status in the Symfony profiler toolbar.
Stars: ✭ 21 (-86.96%)
Mutual labels:  toolbar
feedspora
FeedSpora posts RSS/Atom feeds to your social network accounts.
Stars: ✭ 31 (-80.75%)
Mutual labels:  atom
Cake
Yummy syntax theme for Atom, Brackets, Sublime Text and Visual Studio Code
Stars: ✭ 47 (-70.81%)
Mutual labels:  atom
haskell-debug
Implements a graphical haskell debugger in atom, using ghci
Stars: ✭ 21 (-86.96%)
Mutual labels:  atom
linter-glsl
Atom package that lints GLSL shaders on the fly.
Stars: ✭ 15 (-90.68%)
Mutual labels:  atom
linter-mypy
Atom Linter plugin to lint Python optional static type as defined in PEP 484
Stars: ✭ 29 (-81.99%)
Mutual labels:  atom
Switch
Manage chrome extensions from the toolbar
Stars: ✭ 13 (-91.93%)
Mutual labels:  toolbar
atom-change-case
atom plugin for node-change-case
Stars: ✭ 34 (-78.88%)
Mutual labels:  atom
feed2email
RSS/Atom feed updates in your email
Stars: ✭ 37 (-77.02%)
Mutual labels:  atom
CustomToolbar
A mockup of the custom toolbar from Social Steps app on Google Play.
Stars: ✭ 28 (-82.61%)
Mutual labels:  toolbar
atom-carbon-now-sh
Atom package to open the current editor content in https://carbon.now.sh/
Stars: ✭ 15 (-90.68%)
Mutual labels:  atom
tabnine-atom
Atom client for Tabnine - Code Faster with the All-Language AI Assistant for Code Completion, autocomplete JavaScript, Python, TypeScript, PHP, Go, Java, node.js, Ruby, C/C++, HTML/CSS, C#, Rust, SQL, Bash, Kotlin, React, Swift, Scala, Sass, Perl, Objective C, Node JS, Matlab, Haskell, Dart, Angular. https://atom.io/packages/tabnine
Stars: ✭ 33 (-79.5%)
Mutual labels:  atom
atom-lazy-motion
Rapid cursor positioning with fuzzy search.
Stars: ✭ 21 (-86.96%)
Mutual labels:  atom
vuepress-plugin-feed
RSS, Atom, and JSON feeds generator plugin for VuePress 1.x
Stars: ✭ 46 (-71.43%)
Mutual labels:  atom
python-tools
🔧 Atom plugin which uses jedi to provide numerous tools useful for developing python code in atom.
Stars: ✭ 96 (-40.37%)
Mutual labels:  atom
atom-php-cs-fixer
Run the 'PHP Coding Standards Fixer' within Atom
Stars: ✭ 30 (-81.37%)
Mutual labels:  atom

Atom Tool Bar

CI apm Chat

This package provides extensible tool bar for Atom.

Note: this package by itself adds an empty toolbar. To propagate it with icons you can install plugins.

Horizontal

Vertical

Different Sizes

Light Theme

Configuration

Position

On which edge of the editor should the tool bar appear. Possible options:

  • Top
  • Right
  • Bottom
  • Left

Icon size

  • Infinitesimal (12px)
  • Tiny (14px)
  • Very Small (16px)
  • Small: (18px)
  • Medium: (21px)
  • Big (24px)
  • Very Big (28px)
  • Huge (32px)

Visibility

  • Visible
  • Hidden

Full Width (available in Atom >= 1.7)

When on top/bottom, expand to full window width.

Use TouchBar

If your computer is equipped with a TouchBar (only Apple MacBook Pro series currently) it can display up to seven tool bar buttons there.

Plugins

Packages using tool-bar

Integrating instructions

By itself this package shows an empty tool bar. To add buttons and spacers to the tool bar, follow the instructions below.

Package.json

Make sure the following properties are part of your package.json.

"consumedServices": {
  "tool-bar": {
    "versions": {
      "^0 || ^1": "consumeToolBar"
    }
  }
}

We recommend using Atom-Package-Deps in your package for installing dependency packages like this package.

Main package file

In your main package file, add the following methods and replace your-package-name with your package name.

let toolBar;

export function consumeToolBar(getToolBar) {
  toolBar = getToolBar('your-package-name');
  // Add buttons and spacers here...
}

export function deactivate() {
  if (toolBar) {
    toolBar.removeItems();
    toolBar = null;
  }
}

Example

let toolBar;

export function consumeToolBar(getToolBar) {
  toolBar = getToolBar('your-package-name');

  // Adding button
  toolBar.addButton({
    icon: 'octoface',
    callback: 'application:about',
    tooltip: 'About Atom'
  });

  // Adding spacer
  toolBar.addSpacer();

  // Using custom icon set (Ionicons)
  const button = toolBar.addButton({
    // For Material style icons, use md- prefix instead
    icon: 'ios-gear-a',
    callback: 'application:show-settings',
    tooltip: 'Show Settings',
    iconset: 'ion'
  });

  // Disable button
  button.setEnabled(false);

  // Function with data in callback
  toolBar.addButton({
    icon: 'alert',
    callback(data) {
      alert(data);
    },
    tooltip: 'Show Alert',
    data: 'foo'
  });

  // Callback with modifiers
  toolBar.addButton({
    icon: 'octoface',
    callback: {
      '': 'application:cmd-1',      // Without modifiers is default action
      'alt': 'application:cmd-2',
      'ctrl': 'application:cmd-3',  // With function callback
      'shift'(data) {
        console.log(data);
      },
      'alt+shift': 'application:cmd-5',       // Multiple modifiers
      'alt+ctrl+shift': 'application:cmd-6'   // All modifiers
    },
    data: 'foo'
  });

  // Calling multiple callbacks at once
  toolBar.addButton({
    icon: 'octoface',
    callback: ['application:cmd-1', 'application:cmd-2']
  });  

  // Adding spacer and button at the beginning of the tool bar
  toolBar.addSpacer({priority: 10});
  toolBar.addButton({
    icon: 'octoface',
    callback: 'application:about',
    priority: 10
  });

  // Adding text button
  toolBar.addButton({
    text: 'hello',
    callback: 'application:about'
  });

  // Text buttons can also have an icon
  toolBar.addButton({
    icon: 'octoface',
    text: 'hello',
    callback: 'application:about'
  });

  // Text buttons can be html
  toolBar.addButton({
    icon: 'octoface',
    text: '<b>BIG</b> button',
    html: true,
    callback: 'application:about'
  });

  // Text buttons can be colored
  toolBar.addButton({
    icon: 'octoface',
    callback: 'application:about',
    tooltip: 'About Atom',
    color: 'red' // color of the text or icon
    background: 'black' // color of the background
  });

  // Buttons can be styled with arbitrary CSS through classes.
  // An example of how the class can be used is show below.
  toolBar.addButton({
    icon: 'octoface',
    callback: 'application:about',
    class: 'my-awesome-class'
  });
  toolBar.addButton({
    icon: 'octoface',
    callback: 'application:about',
    class: ['multiple', 'classes', 'also', 'works']
  });

  // Cleaning up when tool bar is deactivated
  toolBar.onDidDestroy(() => {
    this.toolBar = null;
    // Teardown any stateful code that depends on tool bar ...
  });
}
/*
Follow the instructions at:
https://flight-manual.atom.io/using-atom/sections/basic-customization/#style-tweaks
to define your classes.
*/
.my-awesome-class {
  background-image: url(data:image/svg+xml;base64,...);
  background-repeat: no-repeat;
  background-position: center;
}

Methods

.addButton({icon, iconset, text, html, callback, priority, tooltip, data, color, background})

The method addButton requires an object with at least the property callback. The callback must be an Atom command string, a custom callback function or an object where the keys are key modifiers (alt, ctrl or shift) and the values are commands or custom functions (see example).

The remaining properties tooltip (default there is no tooltip), text (default there is no text), html (default false), icon (default there is no icon), iconset (defaults to Octicons), data, priority (defaults 50), color, background, and class are optional.

The tooltip option may be a string or an object that is passed to Atom's TooltipManager

The return value of this method shares another method called setEnabled(enabled) to enable or disable the button.

.addSpacer({priority})

The method addSpacer has only one optional property priority (defaults 50).

.addItem({element, priority})

Adds a custom HTML element as an item to the tool-bar. Arguments are:

  • element: pass your HTML element.
  • priority: optional field specifying the position of the item.

.removeItems()

Use the method removeItems to remove the buttons added by your package. This is particular useful in your package deactivate method, but can be used at any time.

.onDidDestroy(callback)

The onDidDestroy method takes a function that will be called when the tool-bar package is destroyed. This is useful if your package needs to do cleanup when the tool-bar is deactivated but your package continues running.

Supported icon sets

Supported commands

  • tool-bar:toggle
  • tool-bar:position-top
  • tool-bar:position-right
  • tool-bar:position-bottom
  • tool-bar:position-left

Authors

Contributors

Issues and pull requests are very welcome. Feel free to write your own packages using this one. For all contributions credits are due:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].