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

New size should only be committed after dragging ends #70

Closed
Janpot opened this issue Jan 9, 2023 · 5 comments
Closed

New size should only be committed after dragging ends #70

Janpot opened this issue Jan 9, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@Janpot
Copy link

Janpot commented Jan 9, 2023

Currently, when dragging panel 'right' and causing another panel 'left' to resize, it immediately commits the new size of the panel 'left', even if I drag panel 'right' back to its original position. See:

Screen.Recording.2023-01-09.at.12.23.14.mov

It feels counterintuitive, since it's quite common that I'm not 100% precise on my drag and will overshoot. Ideally all new sizes are only committed after I release the mouse button and panels spring back to their original position. See e.g. in vscode:

Screen.Recording.2023-01-09.at.12.24.10.mov
@bvaughn
Copy link
Owner

bvaughn commented Jan 9, 2023

I have a TODO in the code somewhere to look into how difficult it would be to implement this behavior. I thought I had a GitHub issue too but it seems I didn't. 😄 I agree this would be a nice change! Don't know when I'll get around to it though.

@bvaughn bvaughn added the enhancement New feature or request label Jan 10, 2023
@bvaughn
Copy link
Owner

bvaughn commented Jan 13, 2023

On a flight today so I have some time to play with this. The idea I've been chewing over in the back of my head is to capture the initial panel sizes when dragging begins– and apply the drag delta to them (rather than to the current sizes). I think this would work out and require very little code.

Edit 1 This idea mostly works but there are some edge cases that don't. Bummer! Maybe it's still feasible though.

Edit 2 I think the thing I may have overlooked with my initial idea was that I would also need to capture the initial rect of the drag handle too, so that the offset calculation stayed relative to it. I'll try that.

@bvaughn
Copy link
Owner

bvaughn commented Jan 17, 2023

This will go out with the next release, 0.0.34

@bvaughn bvaughn closed this as completed Jan 17, 2023
@Janpot
Copy link
Author

Janpot commented Jan 17, 2023

👍 Works well, great work!

@bvaughn
Copy link
Owner

bvaughn commented Jan 17, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants