-
Notifications
You must be signed in to change notification settings - Fork 17.4k
add implementation for resizable panes, just solve the issue #274 #5902
Conversation
…evious and next pane will change.
…fault open url link. add listener for pane's drop event to open dragged files.
@@ -0,0 +1,67 @@ | |||
{$, View} = require 'atom-space-pen-views' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove all references of view and jQuery? We're no longer using space pen or jQuery in core. In place of jQuery, please use the raw DOM APIs.
This looks interesting! A couple things before we can merge:
|
…h PaneResizeHandleElement
I have remove all references to jQeury and |
Really cool! Thanks for this :) Finally split-views make sense! 👏 |
event.preventDefault() | ||
event.stopPropagation() | ||
@getModel().activate() | ||
pathsToOpen = _.pluck(event.dataTransfer.files, 'path') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could write the following i think, so you could remove the dependency to _
(i just saw they are trying that in new packages currently)...
pathsToOpen = event.dataTransfer.files.map (file) -> file.path
See array.map
Update:
I just saw that dataTransfer.files returns a FileList, so array.map won't be available unless you convert it to one :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now I have removed the dependency to _ and replaced with Array::map.
pathsToOpen = Array::map.call event.dataTransfer.files, (file) -> file.path
Thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you push this change? I'm still seeing _
being used at the head of your branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
He removed it in the second PR #5910
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really would like to merge this stuff, but I need a single consolidated PR with good test coverage first. Can someone else from the community collaborate on the test side of things?
hey @liuxiong332 , I had a chance to take a look at this today and overall this looks great. The approach I had taken was to integrate this within the resize-pane package, but that had several challenges when purely relying on the callbacks. I like the approach you took here of adding this to core and making the necessary changes to the Pane Axis to adjust the children. I also liked a few additions that I hadn't considered like double-click to balance the frames. Overall this looks like a great fix and if this gets integrated into core then I can just shelve the work I was doing on the other package. Looking through your repo, it looks like you've also updated but not yet committed the resize-pane package to accommodated for this new approach, which is great. I just had a few comments on my end based on my experience working on that the last few weeks, but nothing that should prevent moving forward with this.
In either case, glad to see that this is getting added and if there is anything that I can do to help get that merged into core let me know. Overall great work. Cheers, |
@simurai Can you weigh in on the design aspects of this? Note the thickened draggable border that's added between panes. @liuxiong332 The updated pane size isn't being serialized down into the model, so it gets blown away on refresh. Could you explore adding that? We really want refresh to be a first-class concept so the view state is retained as much as possible when people do it. |
createdCallback: -> | ||
@classList.add('test-root') | ||
|
||
TestItemElement = document.registerElement 'atom-test-item-element', prototype: TestItemElement.prototype |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should be able to use a generic div
element to test this rather than registering your own. Adding a custom element here adds complexity and it also can never be registered with the current custom elements API.
- Keeps most themes unaffected - More consistent with the tree-view resizer
Wouldn't be a huge issue, but to keep most themes visually untouched, I made a PR on top of this one: liuxiong332#1 It removes the "thickened draggable border" and instead the |
Looks really good @simurai :) Already happy to get this one merged! |
absolute positions the pane resize-handles and overlap the editor
Looks good @simurai . Thank you! |
I implemented something like this as a temporary fix before this is merged |
leftPane.close() | ||
expectPaneScale [rightPane, 1] | ||
|
||
it "split or close panes in orthogonal direction", -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
splits or closes adjacent panes
Again, not sure if this is accurate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just want to test that the scale of horizontal panes is not changed when the vertical panes are added or removed.
/cc @maxbrunsfeld |
Thanks a lot @liuxiong332. A lot of people will be excited to have this feature. |
add implementation for resizable panes, just solve the issue #274
Whaaat its mergeeed 💥 Thanks @liuxiong332 for working on this!! :) |
Awesome ⚡❗ |
🎉 🎉 Pulling and building... |
Yahoo! well done @liuxiong332 |
Awesome!! |
Wow, fantastic work @liuxiong332! |
😻 |
👏 so pumped about this. awesome work @liuxiong332. thank you! |
👏 thanks @liuxiong332! |
Thanks @liuxiong332! One minor issue: The resize icon is not the same that appears when resizing the file drawer. |
/cc @simurai on this slight inconsistency. |
I noticed this recently broke in the latest version of atom. I can no longer use cmd+alt-- to shrink or expand windows, thoughts? |
Can you add this to atom in ubuntu? I'm running on ubuntu 14.04 LTS and atom 1.0.2 and none of the panes are resizable. Also commented on #274. Thanks! |
this commit request implement resizable panes and achieve the feature of #274.
printscreen:

approach
the approach is inserting resizable view (named pane-resize-handle-view) between two panes. when user move the resizable view, I will change the pane's flexGrow style value by two pane's width or height ratio. for example, if the left pane is 200px and the right pane is 600px, then I will modify flexGrow style to 0.5 and 1.5.
This way is like tree view's resizable view.