oakes / Nightlight

An embedded editor for Clojure
https://sekao.net/nightlight/
The Unlicense
788 stars 35 forks source link

Make Tree view sidebar resizable #52

Closed roman01la closed 6 years ago

roman01la commented 6 years ago

Thanks for making this! This PR makes it possible to adjust Tree view sidebar width and persist the value into Nightlight's config.

oakes commented 6 years ago

Looks great. A few things:

  1. It seems that there is a typo in the CSS, as it is broken for me. I think .leftsidebar needs an end bracket.
  2. After fixing the CSS it works for me, but on windows the line isn't really visible because it is sitting flush with the scroll bar: image
  3. When I dragged it all the way to the left (so the left-sidebar-width was 0) I was unable to drag it anymore. Probably has to do with the windows scrollbar getting in the way.

Maybe there's another way to display a resizer control? When I get time i'll try to think of one...

roman01la commented 6 years ago

Thanks for taking a look. I’ll update the PR with fixes.

roman01la commented 6 years ago

Added hide/show buttons to deal with 3rd issue, also fixed CSS, sorry it was reformatted in my editor :( google chrome_2018-06-01 12-14-35 google chrome_2018-06-01 12-14-51

oakes commented 6 years ago

Thanks, this is a good solution. I added some styling fixes and prevented the toolbar from moving when resizing (it was overlapping with the settings). Let me know if you notice any problems due to my changes. After i get a chance to try it more i'll push a release.

roman01la commented 6 years ago

I was about to make InstaREPL resizable as well, what do you think?

oakes commented 6 years ago

Yeah that sounds great. Since it can be toggled off, we should probably have a minimum size. Otherwise it could get into a state where toggling on/off doesn't appear to do anything.

oakes commented 6 years ago

Had to temporarily move the resizer stuff to https://github.com/oakes/Nightlight/tree/resizer because it looks like things are broken during advanced compilation. Might be something I did, I'm not sure. I'll look into it when i get the chance

oakes commented 6 years ago

I released version 2.2.2 with sidebar resizing included. Turns out that the broken compilation only seems to happen on Windows, so I just compiled the release in WSL and it seems to work fine.