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

Change tooltip position based on toolbar position #68

Closed
kankaristo opened this issue Jun 6, 2015 · 3 comments
Closed

Change tooltip position based on toolbar position #68

kankaristo opened this issue Jun 6, 2015 · 3 comments

Comments

@kankaristo
Copy link
Contributor

Thanks for a great package, makes Atom feel a lot more like an IDE. :)

However, the tooltips for the buttons appear on top of the buttons (I have my toolbar on the left side).

TooltipManager::add has an option to set the position (placement) of the tooltip.

The tooltip position should ideally be opposite of the toolbar position. So if the toolbar is at the top, the tooltip should be shown below; if the toolbar is on the left, the tooltip should be on the right.

This is what I did in tool-bar-button-view.coffee:

if options.tooltip
  @prop 'title', options.tooltip
  @subscriptions.add atom.tooltips.add(
    this,
    {
      title: options.tooltip
      delay:
        show: 0
        hide: 0
      placement: 'right'  # Opposite of the toolbar's position
    }
  )

(I also set the delay to 0, by personal preference).

Do you think this could be made the default behavior?

@jerone
Copy link
Contributor

jerone commented Jun 6, 2015

Hi @kankaristo, thanks for using this package.

I like your idea 💡 of placing the tooltips to the side when the tool-bar is vertical. On a horizontal tool-bar the tooltips are already placed correctly.

For the delay part, I prefer to keep this in sync with the tabs package or default value as with status-bar package.

Would you like to do a PR?

@kankaristo
Copy link
Contributor Author

Pull request: #69

@kankaristo
Copy link
Contributor Author

Fixed in b2a9e65

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

2 participants