Hirse / brackets-outline-list

Extension for Brackets and Phoenix to display a list of the functions or definitions in the currently opened document.
MIT License
79 stars 30 forks source link

Autohide feature. #82

Closed pelatx closed 7 years ago

pelatx commented 7 years ago

Hi.

This PR adds the AutoHide feature, similar to the one described in the old issue #17.

This works by adding an entry in the preferences context menu to enable/disable the feature.

When enabled, clicking on the editor results in hidding the Outline List. To unhide it relies on the default behavior of the extension: click on the button on main toolbar.

Greetings.

Hirse commented 7 years ago

For hiding the outline, does it work to use the showOutline function instead of toggling the enabled setting? When the enabled is changed, the Outline will be re-generated, which is not strictly necessary.

pelatx commented 7 years ago

I first implemented it using the hideOutline function. But the button on the main toolbar remains highlighted and needs two clicks to show the Outline List again.

Being a little bit lazy I chose the fast way, hehe.

Hirse commented 7 years ago

That makes sense.

If you look at the extension in the issue, it adds a placeholder area on the side that you can click on to show it. That would probably be the ideal solution.

pelatx commented 7 years ago

Oh, I did not watch the video of that extension.

I agree that it seems the right thing to do. Working ...

pelatx commented 7 years ago

@Hirse, I have been testing different things and the one I have found more comfortable to use and, moreover, easier to implement is a "pure" auto-hide. No clicks, just "hovering" the main toolbar to unhide and the editor area to hide.

You can see it in this video.

What do you think about it?

Hirse commented 7 years ago

Looks cool. I think that could work.

One thing though, in the video it looks like the bottom status bar is disappearing when you hover-open the outline.

pelatx commented 7 years ago

Yes, It disappears. But nothing to do with Outline List. My Brackets installation does this sort of things frequently.

I have checked out a git branch containing version 1.0.1, without any of my last commits, and the same thing happens. But not always.

Maybe this is related to the Linux version. I have a Windows 10 virtual machine with Brackets installed and It works correctly.

I have updated the video of the link above. I have not written any line of code more since I recorded the first one, and It does not happen this time.

I've moved the toggle to the View menu. Also it seems that the Auto-hide works correctly.

But I will not commit yet because I'm going to try a placeholder. Without it, when No Distractions mode is activated, the hover area gets lost (not when in sidebar).

Hirse commented 7 years ago

Thanks. Good thinking. 👍

pelatx commented 7 years ago

Sorry for the last and too many commits to pass tests.

Auto-hide now uses showOutline and hideOutline functions to work. Added placeholder when hiding (only when it is beside the toolbar). It uses the mouseenter event now, instead of click.

Hirse commented 7 years ago

No problem, thanks for the changes.

I'll have to play around with it myself later.

pelatx commented 7 years ago

Bad implementation after all.

Do not waste time with this PR. If you're doing it, sorry about that.

If I can, I will do a full re-writing.

Hirse commented 7 years ago

Don't worry about it. I am grateful that you spend the effort and time on making a contribution.

Btw, an update of the Spanish translation is highly appreciated, regardless of the state of this feature. 😉