Commit Graph

79 Commits

Author SHA1 Message Date
Nathan Sobo
0a92b6b681 Add Workspace::paneForItem 2014-11-10 08:20:59 -07:00
Nathan Sobo
b8d2bd6c30 Disallow activation of panes that aren't in the PaneContainer
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2014-11-07 15:46:47 -07:00
Nathan Sobo
6934b83acc Fall back to first pane if activePaneId is invalid
When deserializing PaneContainer.

Fixes #4069

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2014-11-07 15:44:59 -07:00
Nathan Sobo
003b67ee19 Add TextEditorElement and make TextEditorView a wrapper around it
This is the next step on converting all internal views to custom
elements instead of using SpacePen. The TextEditorElement instances
are associated with ::__spacePenView fields that are used for supporting
legacy access paths via atom.workspaceView.
2014-10-08 12:13:13 -07:00
Nathan Sobo
1c58438124 Move PaneContainerView::confirmClose to the model layer 2014-09-24 15:46:01 -06:00
Nathan Sobo
465d2afd95 Remove the old root view properly 2014-09-24 15:28:34 -06:00
Nathan Sobo
da87f321e8 Add PaneAxisElement 2014-09-24 15:28:34 -06:00
Nathan Sobo
2710c06313 WIP: First stab at custom element for panes
Still need to create a SpacePen shim for access via `atom.workspaceView`
property so we’re backward compatible with packages, but it basically
works.
2014-09-24 15:28:33 -06:00
Nathan Sobo
55cce48af1 Throw an exception if the same pane item is added twice in the workspace 2014-09-19 16:24:13 -06:00
Nathan Sobo
0877721ce9 Construct PaneAxisViews and PaneViews via ViewRegistry 2014-09-19 16:24:12 -06:00
Nathan Sobo
53bd1c8958 Use Workspace::getView to build PaneContainerView 2014-09-19 16:24:12 -06:00
Nathan Sobo
a33706ddbc Add PaneContainer::onDidAddPaneItem and ::observePaneItems 2014-08-28 17:42:12 -06:00
Nathan Sobo
cee7539e35 Add PaneContainer::observePanes and ::onDidAddPane 2014-08-28 17:22:28 -06:00
Nathan Sobo
5471e9bccc Add PaneContainer::onDidDestroyPaneItem 2014-08-28 16:58:38 -06:00
Nathan Sobo
9223361c22 Add PaneContainer::onDidChange/observeRoot
Also, don’t use a behavior to monitor root changes
2014-08-28 14:42:13 -06:00
Nathan Sobo
74b2f26540 Add PaneContainer::onDidChangeActivePaneItem 2014-08-28 14:41:56 -06:00
Nathan Sobo
87cdc1a45d Don’t invoke ::onDidChangeActivePane events unless it really changes 2014-08-28 11:43:08 -06:00
Nathan Sobo
2b63f8a4ee Add PaneContainer::onDidChangeActivePane 2014-08-28 11:43:07 -06:00
Nathan Sobo
2d58d9c8b5 Add Pane::onDidActivate 2014-08-28 11:43:07 -06:00
Nathan Sobo
b2c70f9e69 Move serialization of active pane from Pane to PaneContainer
Fixes #2694
Fixel #2853

Previously, we were storing an `active` boolean for each pane. We've
had some strange bugs where every pane is serializing `active: false`,
which causes exceptions when loading up the stored data.

This new approach serializes the activePaneId on the PaneContainer
itself. Since the PaneContainer is the source of truth regarding the
active pane, it makes more sense to handle it here.

This unfortunately changes the serialization version for the
PaneContainer, so people won't have their state persisted after
upgrading. But it seems better than leaving cruft to handle the old
serialization situation.
2014-07-07 16:36:10 -06:00
Corey Johnson
d6ec73886f Add PaneContainer::getActivePane 2014-04-15 14:55:28 -07:00
Kevin Sawicki
932a792289 Remove Private: prefix 2014-02-06 10:02:53 -08:00
Nathan Sobo
ccd86d91de Make PaneContainer::activePaneItem behavior distinct until changed
If we switch from one empty active pane to another empty active pane,
there's no reason to emit a value from the activePaneItem behavior.
2014-01-15 16:08:36 -07:00
Nathan Sobo
5e14d44d6a Destroy all pane models when workspace view is removed 2014-01-15 16:07:47 -07:00
Nathan Sobo
9af4b14716 Never allow PaneContainer::root to be null 2014-01-15 16:07:47 -07:00
Nathan Sobo
1a48903f96 Only destroy empty panes on deserialization if config option is enabled 2014-01-15 16:07:47 -07:00
Nathan Sobo
4a7b43f609 Write focusNext/PreviousPane in terms of activateNext/PreviousPane
"Activate" is the model level equivalent of focus.
2014-01-14 11:15:14 -07:00
Nathan Sobo
89cbd6b834 Move PaneContainerView::saveAll to the model 2014-01-14 10:58:35 -07:00
Nathan Sobo
a8ddc530a2 Emit a pane-item-destroyed event from the workspace model
…Instead of calling itemDestroyed on the workspace view via a DOM query
2014-01-14 10:58:34 -07:00
Nathan Sobo
7317d52896 Move paneForUri to PaneContainer model 2014-01-14 10:58:34 -07:00
Nathan Sobo
97999f1080 Rename PaneContainerModel to PaneContainer 2014-01-13 13:56:31 -07:00
Nathan Sobo
918c31905f Rename PaneContainer to PaneContainerView 2014-01-13 13:46:28 -07:00
Nathan Sobo
4f604ced3c Rename Pane to PaneView 2014-01-13 13:46:22 -07:00
Nathan Sobo
3fc3d48def Destroy empty panes after deserializing
Fixes #1399
2014-01-12 17:53:25 -07:00
Nathan Sobo
28b085be1c Rename ::makeActive to ::activate and focus panes when they're activated 2014-01-11 20:48:01 -07:00
Nathan Sobo
3ab7836ab2 Upgrade to emissary 0.31.0 for implicit 'value' subscriptions on signals
Previously, when you always had to specify the event name of 'value'
when calling `::subscribe` with a signal. Now, if you don't specify an
event name, 'value' is assumed.
2014-01-11 11:22:31 -07:00
Nathan Sobo
e2170ea907 Remove unused requires and mixins 2014-01-11 10:45:33 -07:00
Nathan Sobo
72fe586101 Remove the concept of focus from the model 2014-01-10 17:27:28 -07:00
Nathan Sobo
c7fded0d7f Only emit 'pane:removed' events if the pane is actually destroyed
The pane may only be detached temporarily during splitting/unsplitting
2014-01-10 15:04:51 -07:00
Nathan Sobo
1ee783fdb9 Base PaneContainer::getActivePane on the model's active pane 2014-01-10 13:44:02 -07:00
Nathan Sobo
d2146f9b2e Emit 'pane:removed' event in container when last pane is removed
Doing it in the pane view is awkward because the view may have already
been detached.
2014-01-10 11:45:08 -07:00
Nathan Sobo
edfc86f153 Make PaneContainer::getActivePaneItem retrieve it from the model 2014-01-10 11:34:26 -07:00
Nathan Sobo
1c7eef89c3 Merge branch 'master' into ns-pane-splits-with-models 2014-01-10 10:40:52 -07:00
Nathan Sobo
9aefafb831 Use PaneContainerModel::$activePaneItem for 'active-item-changed' events
Yay behaviors
2014-01-09 18:58:01 -07:00
Nathan Sobo
5a3353ec28 Add PaneContainer view to deserializers 2014-01-09 18:35:16 -07:00
Nathan Sobo
e87b8dc463 Remove focusNext/PreviousPane methods from PaneContainer view 2014-01-09 18:35:01 -07:00
Nathan Sobo
cd699d8b9b Transfer focus to the root view when the last focused pane is destroyed 2014-01-09 18:17:08 -07:00
Kevin Sawicki
20ee7b432c Wrap item in array since it is a trigger call 2014-01-09 15:18:44 -08:00
Nathan Sobo
8efcb1abfa Remove pane splitting/unsplitting logic from view
There's still some failing specs around focus management, but it's
getting closer.
2014-01-09 12:19:01 -07:00
probablycorey
7eba9d3a23 Use flexbox to arrange panes 2014-01-08 14:29:32 -08:00