Commit Graph

45 Commits

Author SHA1 Message Date
Kevin Sawicki & Nathan Sobo
501dc9b76c Merge remote-tracking branch 'origin/master' into cefode
Conflicts:
	native/v8_extensions/native.mm
	spec/app/config-spec.coffee
	spec/app/window-spec.coffee
	spec/spec-helper.coffee
	spec/stdlib/fs-utils-spec.coffee
	src/app/atom-package.coffee
	src/app/config.coffee
	src/app/window.coffee
	src/packages/fuzzy-finder/lib/load-paths-handler.coffee
	src/packages/markdown-preview/lib/markdown-preview-view.coffee
	src/packages/tree-view/spec/tree-view-spec.coffee
	src/stdlib/require.coffee
2013-03-20 10:46:50 -06:00
Kevin Sawicki & Nathan Sobo
d8a3848c1a Round top position before comparing to height 2013-03-12 14:40:39 -07:00
Corey Johnson & Nathan Sobo
d84614866a Add Pane.getNextPane 2013-03-07 14:32:10 -08:00
Corey Johnson & Nathan Sobo
4f0bf9020b Fix pane focus and active item serialization
Also: Un-x root view serialization specs
2013-03-07 09:30:29 -08:00
Corey Johnson & Nathan Sobo
d4fc718e8e Update window title when a pane item's title changes 2013-03-07 09:30:29 -08:00
Corey Johnson & Nathan Sobo
5ad53bb32c Add restoreItem to Pane container 2013-03-07 09:30:29 -08:00
Nathan Sobo
f2e5fcc902 Move autosave from editor into panes 2013-03-07 09:30:29 -08:00
Nathan Sobo
d97e91bdcb Make meta-# bindings work with new panes 2013-03-07 09:30:29 -08:00
Nathan Sobo
f23d9091f2 Add pane:close-other-items 2013-03-07 09:30:29 -08:00
Nathan Sobo
4b8d786d2a 💄 2013-03-07 09:30:29 -08:00
Nathan Sobo
48c693d756 Add 'pane:close' event, which destroys all pane items.
Still have some issues with the presentation order of dialogs with
multiple unsaved buffers and no paths. But for the 99% case this works
as is.
2013-03-07 09:30:28 -08:00
Nathan Sobo
3f9ee08e76 Handle save-as on pane. Replace 'editor:save-as' w/ 'core:save-as'
Pane will only show the saveAs dialog if the item has a `saveAs` method.
2013-03-07 09:30:28 -08:00
Nathan Sobo
699e780e99 Handle save in panes with new 'core:save' event 2013-03-07 09:30:28 -08:00
Nathan Sobo
6ae684d609 Kill commented specs that were used as a reminder 2013-03-07 09:30:28 -08:00
Nathan Sobo
9f7b804a6c Panes prompt to save modified items before destroying them 2013-03-07 09:30:27 -08:00
Corey Johnson & Nathan Sobo
ae95c04bbc Focus next pane when removing the last pane item of a focused pane
Previously, removing the last pane item also ruined our ability to 
determine if the pane had focus. Now, if we're removing the last item,
we instead just go ahead and remove the entire pane. Remove contains
logic to switch focus to the next pane if its active view is focused,
which works as intended if we leave the active view in place.
2013-03-07 09:30:26 -08:00
Corey Johnson & Nathan Sobo
52b649dca5 Preserve focus when switching between pane items
If the pane is currently focused, when showing a view associated with
a new item, focus that view.
2013-03-07 09:30:26 -08:00
Nathan Sobo
fab3b4564e Add Pane.moveItemToPane specs. Fix bug moving the last edit session. 2013-03-07 09:30:25 -08:00
Nathan Sobo
2e2ff3a1d0 Add Pane.destroyItem and rename removeActiveItem -> destroyActiveItem
Pane.removeItem removes an item, but no longer tries to call destroy
on it. This will facilitate moving items between panes.
2013-03-07 09:30:24 -08:00
Nathan Sobo
887b5ea007 Add Pane.moveItem(item, index)
This is the precursor to supporting drag/drop of tabs within and
between panes.
2013-03-07 09:30:24 -08:00
Nathan Sobo
5240d9989f Pane emits 'pane:item-removed' events 2013-03-07 09:30:23 -08:00
Nathan Sobo
dd120663b7 Pane emits 'pane:item-added' events 2013-03-07 09:30:23 -08:00
Nathan Sobo
a40d05f6ee Rename Pane.currentItem/View to activeItem/View 2013-03-07 09:30:23 -08:00
Nathan Sobo
15d8a6cada Simplify pane:active-item-changed events
Panes now trigger an event every time their active item changes,
regardless of whether the pane itself is active. Panes also trigger
events when the become active and when they are removed. The rootView
now scopes its active-item-changed event listener only to active panes,
and also listens to listens to pane activation and removal events to
update the title when switching active panes and removing the last
pane.
2013-03-07 09:30:23 -08:00
Kevin Sawicki & Nathan Sobo
3ae9c10ff5 Trigger 'pane:active-item-changed' w/ null when last pane is removed 2013-03-07 09:30:22 -08:00
Kevin Sawicki & Nathan Sobo
161ed69ef0 When a pane is removed, focus/activate the next pane 2013-03-07 09:30:22 -08:00
Kevin Sawicki & Nathan Sobo
4a6f05ae4e Trigger 'pane:active-item-changed' on Pane
This event is triggered when the item changes on the active pane, or
when a different pane becomes active.

Also: Pane now sets itself as the active pane, rather than letting
PaneContainer handle the focusin event.
2013-03-07 09:30:22 -08:00
Kevin Sawicki & Nathan Sobo
ad62f896bc Make Pane maintain a currentView pointer based on its current item 2013-03-07 09:30:21 -08:00
Nathan Sobo
2ba63e608f Don't allow core:close event to bubble out of Pane 2013-03-07 09:28:52 -08:00
Nathan Sobo
8f980a0f20 Replace Editor's next/previous edit session bindings w/ pane bindings 2013-03-07 09:28:52 -08:00
Nathan Sobo
bd8ec81b1e Make Pane close the current item when handling 'core:close' event 2013-03-07 09:28:52 -08:00
Nathan Sobo
11a702a2a6 Remove pane when its last item is removed 2013-03-07 09:28:52 -08:00
Nathan Sobo
fee835f899 Add a PaneContainer subview for RootView
PaneContainer is responsible for all pane-related logic. Laying them
out, switching focus between them, etc. This should help make RootView
simpler and keep pane-layout related tests in their own focused area.
2013-03-07 09:28:52 -08:00
Nathan Sobo
19e2cab920 💄 2013-03-07 09:28:52 -08:00
Nathan Sobo
0c2a5f273c Enhance pane split methods. Spec them in pane-spec.
When a pane is split, it attempts to make a copy of its current item
if no items are passed to the split method. When splitting, multiple
items can also be passed to the constructor of the new pane.
2013-03-07 09:28:52 -08:00
Nathan Sobo
45eec6a8ff Get more specs passing. Failing specs due to missing features. 2013-03-07 09:28:52 -08:00
Nathan Sobo
281a28bb0e Add spec for pane focusing the its current item view when it's focused 2013-03-07 09:28:52 -08:00
Nathan Sobo
568fcf441e Pane serializes its serializable items 2013-03-07 09:28:52 -08:00
Nathan Sobo
829bfa0a10 Add Pane.itemForPath 2013-03-07 09:28:51 -08:00
Nathan Sobo
62729c42ee Panes destroy their items when they are removed
As a consequence of these changes, editors will no longer need to
listen for destruction of their edit sessions. An editor will
eventually only ever be displaying a single edit session, and the
editor will destroy that edit session when it is removed. Panes
will be responsible for supporting multiple edit sessions, and
they will automatically remove the editor when they have no more
edit session items.
2013-03-07 09:28:51 -08:00
Nathan Sobo
d89a7eb522 When showing an item on a pane, add it to the items list if needed 2013-03-07 09:28:51 -08:00
Nathan Sobo
41f18ee6a2 Add Pane.removeItem 2013-03-07 09:28:51 -08:00
Nathan Sobo
ef0c62f532 Add show next / previous item. 2013-03-07 09:28:51 -08:00
Nathan Sobo
372393d9ca Allow panes to have model objects as items in addition to views
The problem I've been struggling with is that we need to potentially 
assign tabs both to EditSessions and also to other views added by
extensions, like a markdown preview view. EditSessions are however not
actually views… instead they plug into editors. The solution is to
have the pane ask a model object what view should be used to render
it. When asked to show a non-view item, the pane constructs and
appends a view for that item or recycles an appropriate view that it
has already appended.
2013-03-07 09:28:51 -08:00
Nathan Sobo
2bdc077d2a Construct Pane w/ multiple items. Show first item on construction. 2013-03-07 09:28:51 -08:00