Skip to content
This repository has been archived by the owner on Jul 8, 2021. It is now read-only.

Some restyling #17

Merged
merged 1 commit into from Jun 13, 2016
Merged

Some restyling #17

merged 1 commit into from Jun 13, 2016

Conversation

simurai
Copy link
Contributor

@simurai simurai commented Jun 10, 2016

This restyles the tooltip a bit:

screen shot 2016-06-10 at 3 14 39 pm
screen shot 2016-06-10 at 3 14 12 pm

Note: I haven't installed Go, so the text is just some dummy text.

color: lighten(@text-color, 50%);
text-shadow: none;
#godoc-message {
// overflow: auto; // TODO: still not getting scroll bars...
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to add some scrolling, but also didn't get it to work. I guess the editor disables scrolling on those overlays. Because it would be scrolling inside a scrolling area and maybe annoying.

How much content will there usually be?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The amount of content totally depends on what the user gets doc for. Generally pretty short for a function, but for a package it could be quite long.

I know what the problem is here, I just don't know how to fix it.

Right now, the size of the div that gets created is always big enough to fit the text, so it doesn't display scrollbars because it doesn't think they're needed. Even if there's a ton of text, it just makes the div thousands of pixels tall (even though most of it is off screen). If I set max-height to something small I do get scrollbars.

This isn't a great solution - it requires me to pick some arbitrary height, and it still behaves funky if the tooltip is displayed near the bottom of the editor.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, ideally it would try to figure out how much space is left at the bottom, if there isn't much, it would show the overlay above. And maybe even taking scroll position into account. I think autocomplete-plus tries to do that, but that's probably custom made.

@simurai
Copy link
Contributor Author

simurai commented Jun 10, 2016

btw. this is good timing, because if atom/atom#11875 gets merged, the .close button would be removed. We could keep it in case you think it's useful.

Or another option might be to auto-close the tooltip as soon as you move the cursor away. Or click somewhere outside. Then the close X wouldn't be needed.

@zmb3
Copy link
Owner

zmb3 commented Jun 10, 2016

Thanks so much for this!

I do like the close button. I think closing the tooltip if the mouse is moved away can be jarring. I generally close the tooltip with the esc key, but for new users that's not always easy or intuitive to discover.

@zmb3 zmb3 merged commit d914014 into zmb3:ui Jun 13, 2016
@simurai simurai deleted the ui branch June 16, 2016 08:02
@simurai
Copy link
Contributor Author

simurai commented Jun 16, 2016

ok, I'll make a note about adding the .close button to atom/atom#11875.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants