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

Add title to tree element #8

Closed
JulienChavee opened this issue Jun 27, 2017 · 7 comments
Closed

Add title to tree element #8

JulienChavee opened this issue Jun 27, 2017 · 7 comments
Assignees

Comments

@JulienChavee
Copy link

JulienChavee commented Jun 27, 2017

Same as xndcn#161

When you have functions or variables that have too long names this one isn't showed completely.

A rapid fix for me was to update the lib/tree-view.coffee file:
@li class: 'list-nested-item list-selectable-item', title: label, =>
and
@li class: 'list-item list-selectable-item', title: label, =>

but has I'm not expert with coffee script I'm not sure this solution is good/enough for all cases.

@nicolashainaux
Copy link
Owner

nicolashainaux commented Jun 28, 2017

I had seen that, but did not understand: if I put a too long name and try your fix, then I cannot see any difference. I do not understand neither, what this fix is supposed to do: is it to prevent from nesting the different levels, to get some more space at right?

So, could you describe a little bit more? Maybe join an example file?

Maybe a resizable panel would be a solution for this? (see #9) (Cannot tell if/when I am able to do this).

@JulienChavee
Copy link
Author

JulienChavee commented Jun 28, 2017

Hello,
My fix just add a title when you hover an element:
screenshot from 2017-06-28 08-33-57

Maybe a resizable panel would be a solution for this? (Cannot tell if/when I am able to do this).

Yeah, it's probably a better solution for long term.

@nicolashainaux
Copy link
Owner

OK, I understand this better.
Still it does not work here. But maybe I didn't understand the fix? I changed this:
@li class: 'list-nested-item list-selectable-item', title: label, =>
into that:
@li class: 'list-item list-selectable-item', title: label, =>
Is this correct and enough?

If I manage to let it work, I guess it's possible to add it as another extra-option (in case this bring any problem, it can be disabled easily).

@JulienChavee
Copy link
Author

JulienChavee commented Jun 28, 2017

Nope. I forgot to update this for this fork.

On line 42, I replaced
@li class: "list-nested-item list-selectable-item#{collapsed}", =>
by
@li class: "list-nested-item list-selectable-item#{collapsed}", title: label, =>

and on line 49
@li class: 'list-item list-selectable-item', =>
by
@li class: 'list-item list-selectable-item', title: label, =>

@nicolashainaux
Copy link
Owner

OK, now I get it! This works fine.

It's certainly very easy to add as an option.

Also, would it be useful to check the length of the label, in order to display only the too long ones?
For instance, instead of being only a boolean (checked/unchecked), the option could contain a natural number, that would be the minimal length to display the title.
0 would mean "no title displayed" (would be the default value, to keep the default symbols-tree-view's behaviour), 1 would lead to display a title for any entry. And anyone that wants it can then adjust the value to fit his/her needs.

@nicolashainaux
Copy link
Owner

Well that's done in the dev branch, seems to work fine. I've set the default value to -1 instead of 0 because 0 wouldn't display anything in the option's field (no idea why), while -1 let display the traditional greyed "Default: -1".
I'll use it for a little while to ensure nothing's obviously wrong. But I'm pretty sure it doesn't break anything since it's so simple, so I guess this can be published soon.

@nicolashainaux
Copy link
Owner

And voilà! Hope everything's correct. If not, it'll be possible to open a new issue. Thanks for your patch proposal!

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