Nathan Sobo
3f844bc953
Fix crash when closing windows
2021-05-05 11:34:49 -06:00
Nathan Sobo
ed28bd3f95
Combine Workspace and WorkspaceView
...
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-05-03 20:15:55 -06:00
Max Brunsfeld
5826a976ef
Return a future from WorkspaceView::open_paths
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-04-29 14:55:28 -07:00
Nathan Sobo
6b357a6ae7
Fix tests
...
I didn't realize a previous change had broken stuff. We need to always call `remove_dropped_entities` and `update_windows` in `flush_effects`, even if there aren't any effects. To achieve this, I use a `loop` to ensure we call these methods at least once before breaking.
2021-04-28 14:16:10 -06:00
Max Brunsfeld
21cfb75a73
Flush redundant fs events in worktree test
...
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-04-28 12:42:39 -07:00
Nathan Sobo
1cb3fdbf7d
Synthesize a mouse moved event in the previous position after painting a scene
...
This ensures that we correctly update the hover state of elements whose position has changed relative to the mouse cursor even though the mouse hasn't actually moved.
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-04-28 13:02:39 -06:00
Nathan Sobo
69cc2b0483
WIP
2021-04-27 18:35:24 -06:00
Nathan Sobo
58e336354e
Align close tab icon cleanly with unsaved indicator
2021-04-27 16:51:23 -06:00
Nathan Sobo
bb95d58c79
Relay hover events to tabs
...
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-04-27 11:37:14 -06:00
Nathan Sobo
fc4b7e2a2a
Introduce MouseEventHandler
...
Still need to give elements the ability to re-render their parent view. Once that is in place, I think we can implement hoverable close tab buttons.
2021-04-26 21:52:18 -06:00
Nathan Sobo
a47b0b4ca6
Add a mechanism for storing ephemeral values
...
I'll use this in the mouse event handler to track hover and click state.
2021-04-26 21:24:23 -06:00
Max Brunsfeld
9fd8acdce7
Use our own scoped_pool implementation
2021-04-20 14:07:36 -07:00
Nathan Sobo
9899614f31
Remove task_done condvar which supported finish_pending_tasks
...
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-04-20 10:45:42 -06:00
Nathan Sobo
1a8e909a38
Ensure we remove broadcast channels after all conditions resolve
...
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-04-20 10:43:13 -06:00
Nathan Sobo
dcc2bdfd4c
Panic when awaiting conditions on dropped entities
...
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-04-20 10:36:54 -06:00
Antonio Scandurra
37444acc9c
Time out condition
after 200ms and add basic unit tests for it
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-04-20 17:21:29 +02:00
Antonio Scandurra
cd7dccd30c
Replace remaining usages of finish_pending_tasks
with condition
2021-04-20 12:28:30 +02:00
Nathan Sobo
a4c1fe5a0b
WIP: Add a condition method to model and view handles for use in tests
...
It returns a future that resolves when the provided predicate returns true. The predicate is called any time the handle's targeted entity calls notify.
Still need to add a timeout and completely remove finsih_pending_tasks.
2021-04-19 22:01:54 -06:00
Nathan Sobo
db8cce9aa9
Merge branch 'master' into rescan
2021-04-14 22:26:09 -06:00
Nathan Sobo
36e6ed3aef
WIP
2021-04-14 12:38:16 -06:00
Nathan Sobo
4cef25eff8
Replace easy-parallel with scoped-pool for path searches
...
The easy-parallel crate spawned new threads on each call, which was resulting in way too many threads.
Co-Authored-By: Brooks Swinnerton <934497+bswinnerton@users.noreply.github.com>
2021-04-14 09:08:52 -06:00
Antonio Scandurra
cf23b0e4a2
Prompt for paths asynchronously to avoid double borrow
2021-04-14 16:30:03 +02:00
Antonio Scandurra
29d2236ed2
Merge pull request #19 from zed-industries/single-global-action-dispatch
...
Dispatch global actions only once when triggering a menu item
2021-04-14 15:50:07 +02:00
Antonio Scandurra
f755cbbe98
Dispatch global actions only once when triggering a menu item
...
Previously we would dispatch the same global action more than once
because we would invoke `dispatch_action_any` _and_
`dispatch_global_action_any`. However, the former already takes care of
going through the global action handlers when no entity in the dispatch
path handled the action.
2021-04-14 14:47:18 +02:00
Antonio Scandurra
40980edffe
Merge branch 'master' into copy-paste
2021-04-14 12:05:52 +02:00
Nathan Sobo
0cc5e8f742
Replace easy-parallel with scoped-pool for path searches
...
The easy-parallel crate spawned new threads on each call, which was resulting in way too many threads.
Co-Authored-By: Brooks Swinnerton <934497+bswinnerton@users.noreply.github.com>
2021-04-13 20:07:42 -06:00
Nathan Sobo
0a2d2aa684
Replace app/app_mut on contexts with AsRef/AsMut impls
...
Co-Authored-By: Brooks Swinnerton <934497+bswinnerton@users.noreply.github.com>
2021-04-13 20:07:25 -06:00
Antonio Scandurra
13514aae6c
Allow metadata to be associated with text written to clipboard
...
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2021-04-13 19:03:56 +02:00
Antonio Scandurra
f4c1ffc329
Start on copy-paste
2021-04-13 14:58:10 +02:00
Max Brunsfeld
902b0f7dfa
Dispatch menu commands on the focused view
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-04-12 15:42:33 -07:00
Max Brunsfeld
d4436f3018
Don't try to handle errors when opening platform windows
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-04-12 15:14:25 -07:00
Max Brunsfeld
86c0f41c9e
Move set_menus method to MutableAppContext
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-04-12 14:38:18 -07:00
Max Brunsfeld
41358f34e3
Set up menu handler in App::new
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-04-12 14:25:00 -07:00
Max Brunsfeld
2332b7e06b
Move open command handler to workspace global action
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-04-12 14:18:24 -07:00
Max Brunsfeld
3247f49954
Allow menu items to specify arguments for their commands
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-04-12 14:09:49 -07:00
Nathan Sobo
4638391412
Remove MutableAppContext::downgrade
2021-04-10 00:14:26 -06:00
Nathan Sobo
620eedb727
Allow effects to be flushed before TestAppContext::update callback completes
2021-04-10 00:11:13 -06:00
Nathan Sobo
97a8a8ed43
Remove unsafe code from App::test_async
...
I don't actually think it was correct to allow the future to borrow a mutable app reference. I went back to passing a wrapper around the refcell to async tests. They'll be a bit more annoying to write but also totally safe.
2021-04-10 00:05:09 -06:00
Nathan Sobo
448dace281
Pass the on_finish_launching callback to Platform::run
2021-04-09 21:33:17 -06:00
Max Brunsfeld
079050541f
Get app running and test passing after gpui App+Platform restructure
2021-04-09 16:56:32 -07:00
Nathan Sobo
4ecc17b1bb
WIP: Make App the only entry point from main
...
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-04-09 13:38:09 -06:00
Nathan Sobo
301163bab7
Add lifecycle methods to Platform trait
...
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-04-09 13:03:26 -06:00
Max Brunsfeld
00d7dafbba
Merge branch 'master' into menus
2021-04-09 10:34:21 -07:00
Max Brunsfeld
334de06322
Create an API for assigning the menubar contents
2021-04-08 16:01:36 -07:00
Nathan Sobo
9f6f27f305
Order debug JSON and allow elements to be named; copy to clipboard
2021-04-07 21:54:14 -06:00
Nathan Sobo
cbb23a93a6
Log prettified element debug JSON to on cmd-alt-i
2021-04-07 21:54:14 -06:00
Nathan Sobo
765c3f9c18
Open platform window before first invalidation
...
This ensures we have an invalidation handler present so we render the first frame in all cases.
2021-04-06 09:15:21 -06:00
Nathan Sobo
2970e934da
Use handles to obtain entities in future callbacks
...
This guarantees that the spawning entity will be present and simplifies
the logic for obtaining the entity. Now we can forward the results of spawned futures and streams in the same way regardless of whether what spawned them was a model or a view.
2021-04-05 20:04:04 -06:00
Max Brunsfeld
fda1394057
Rename Task -> EntityTask (a BackgroundTask is just a Task)
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-04-05 17:03:42 -07:00
Max Brunsfeld
c39c7c3eff
Make background executor available on AppContext
...
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-04-05 16:45:55 -07:00