Commit Graph
488 Commits
Author SHA1 Message Date
Nathan Sobo adc50469ff WIP 2023-08-06 12:45:31 -06:00
Nathan Sobo dcf8b00656 WIP 2023-08-05 18:00:44 -06:00
Nathan Sobo 379652f074 Merge branch 'main' into cells 2023-08-03 19:33:04 -06:00
Nathan Sobo 2d96388be3 Use WindowHandles in a couple places 2023-08-03 17:46:34 -06:00
Nathan Sobo 485c0a482e Don't refcount window handles 2023-08-03 17:11:47 -06:00
Nathan Sobo afcc0d621b WIP 2023-08-03 17:03:39 -06:00
Nathan Sobo 3c938a7377 WIP 2023-08-03 08:10:16 -06:00
Nathan Sobo 8e36da1382 Get tests passing 2023-08-02 15:02:55 -06:00
Nathan Sobo 884cee6dfd Get tests compiling returning WindowHandle<V: View> from add_window 2023-08-02 14:05:03 -06:00
Nathan Sobo 60e190e500 WIP 2023-08-02 12:08:56 -06:00
Nathan Sobo 300ce61bd0 WIP 2023-08-02 08:25:40 -06:00
Nathan Sobo b695c42e11 WIP: Return WindowHandle<V: View> from AppContext::add_window 2023-08-01 22:28:04 -06:00
Nathan Sobo 1dfde8eab5 WIP 2023-08-01 20:53:15 -06:00
Kirill Bulatov 646dabe113 Add buffer search history 2023-08-01 01:31:28 +03:00
Nathan Sobo 480401d65d WIP 2023-07-27 18:23:23 -06:00
Nathan Sobo ab8906551d WIP 2023-07-26 22:37:59 -06:00
Nathan Sobo 0374bc66ce WIP 2023-07-26 12:54:23 -06:00
Nathan Sobo 1b03c5d69c Pass PaintContext to Element::paint
I want to use this on another branch, but it's a sweeping change,
so this prepares the ground for it. This can always be reverted if
it doesn't work out.
2023-07-25 17:32:31 -06:00
Kirill Bulatov a5e63fbf77 Properly display keybindings in context menus 2023-07-20 12:18:04 +03:00
Kirill Bulatov eaa8224076 Use id instead of type_id for actions
Currently, both are the same thing, so the logic is not changed.
2023-07-17 12:24:56 +03:00
Nate Butler 76873c508a Z-2276/Z-2275: Project & Branch switchers (#2662)
This PR adds project and branch switchers in top left corner. 

Release Notes:
- Added a project & branch switcher under project name.
2023-07-05 13:09:40 -04:00
Piotr OsiewiczandAntonio 85add260f6 Track regions instead of clicks.
Get rid of superfluous params in RenderParams related to hover & click state.

Co-authored-by: Antonio <antonio@zed.dev>
2023-07-05 16:48:52 +02:00
Antonio Scandurra 25564ea058 Introduce a WindowContext::focus method that implies the window id 2023-07-05 09:39:04 +02:00
Nathan SoboandAntonio Scandurra 8f8a99d788 Bind cmd-? to assistant::toggle_focus
Bypass system help menu shortcut at the app delegate level to achieve this.

Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-28 11:43:24 +02:00
Piotr Osiewicz 2a3c660d1f settings: accept trailing commas (#2606)
Z-2357

I've found a crate that handles both comments and trailing commas in
JSON. It is a fork of `serde_json`, but it is maintained & up-to-date.
Sadly RawValue seems to not play nicely with it; I've ran into
deserialisation issues around use of RawValue. For this PR I've migrated
to `Value` API.

Obviously this is just a point of discussion, not something I'd merge
straight away. There may be better solutions to this particular problem.

I've also noticed that `serde_json_lenient` does not handle trailing
commas after bindings array. I'm not sure how big of an issue that is.

Release Notes:
- Improved handling of trailing commas in settings files.
[#1322](https://github.com/zed-industries/community/issues/1322)
2023-06-19 18:29:03 +02:00
Joseph Lyons 7c60f636d5 Fix typos 2023-06-02 22:02:19 -04:00
Max Brunsfeld 66b3be8687 Make toggle dock actions appear in the command palette 2023-05-24 09:58:41 -07:00
Antonio Scandurra 4aa2858b2b Transfer focus to root view only if previously-focused view was dropped 2023-05-22 18:05:08 +02:00
Antonio Scandurra 146809eef0 Merge branch 'main' into panels 2023-05-22 14:10:17 +02:00
Antonio Scandurra 747fbfadeb Notify old/new ancestors of the focused view when they change 2023-05-17 17:12:12 +02:00
Antonio Scandurra 981129ef8e Show a panel/pane as zoomed only if it's the active item in workspace 2023-05-17 15:06:58 +02:00
Antonio ScandurraandAntonio Scandurra f87ae6032e Don't rely on action propagation for zooming in and out
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-05-16 10:34:50 -06:00
Nathan Sobo ba50b35de6 wip 2023-05-13 14:34:09 -06:00
Max Brunsfeld cee7edabf9 Ensure the SettingsStore global is added in tests 2023-05-10 16:39:59 -07:00
Antonio Scandurra 9b9d53fcf8 Focus the root view if the previously-focused view isn't rendered 2023-05-10 15:40:46 +02:00
Mikayla Maki 8d561d6408 Make dock not eagerly steal focus from sub items 2023-05-09 12:00:09 -07:00
Antonio Scandurra 080a1f00a3 Delay focus_in event for window activation till after layout 2023-05-05 10:47:42 +02:00
Antonio Scandurra b9ed327b94 Replace usages of is_parent_view_focused with is_self_focused
Previously, this was used because we didn't have access to the current
view and `EventContext` was an element-only abstraction. Now that the
`EventContext` wraps the current view's `ViewContext` we can simply check
for the view's focus and avoid querying ancestors.
2023-05-05 10:08:22 +02:00
Antonio Scandurra 80ad59a620 Make focusing the parent an effect to avoid querying ancestors 2023-05-05 10:04:54 +02:00
Antonio Scandurra da19edc3e3 Merge branch 'main' into implicit-ancestry 2023-05-04 14:39:58 +02:00
Antonio Scandurra 5cc6304fa6 Verify keystrokes can be queried while views are on the stack 2023-05-04 12:09:32 +02:00
Antonio Scandurra 3d679ddb26 Avoid re-allocating KeymapContext after every view notification 2023-05-04 12:04:30 +02:00
Antonio Scandurra 18e39ef2fa Cache view's type id and keymap context into a separate map
During `layout`, we now pass a mutable reference to the element's
parent view. This is a recursive process that causes the view to
be removed from `AppContext` and then re-inserted back into it once
the layout is complete.

As such, querying parent views during `layout` does not work as such
views will have been removed from `AppContext` and not yet re-inserted
into it. This caused a bug in `KeystrokeLabel`, which used the `keystrokes_for_action`
method to query its ancestors to determine their type id and keymap context.

Now, any time a view notifies, we will cache its keymap context so that
we don't need to query the parent view during `layout`.
2023-05-04 10:47:56 +02:00
Antonio Scandurra f6f18be9c3 Remove WindowContext::is_child_focused 2023-05-04 09:53:35 +02:00
Antonio Scandurra 92183e0d72 Ensure querying keystrokes or actions is safe
This is achieved by moving `available_actions` into `AsyncAppContext` (where
we know no view/window is on the stack) and `keystrokes_for_action` into `LayoutContext`
where we'll fetch the previous frame's ancestors and notify the current view if those
change after we perform a layout.
2023-05-04 09:53:31 +02:00
Antonio Scandurra 040cc4d4c3 Allow notifying views when the ancestry of another view is outdated 2023-05-03 19:25:00 +02:00
Antonio Scandurra 9e8f852afb Remove ViewContext::is_child 2023-05-03 19:09:07 +02:00
Antonio Scandurra e9ed40da37 Remove the ability to retrieve the view's parent 2023-05-03 16:52:55 +02:00
Antonio Scandurra 7f137ed3dd Compute view ancestry at layout time 2023-05-03 16:36:14 +02:00
Antonio Scandurra 7f345f8bf5 Separate Window::build_scene into layout and paint 2023-05-03 12:18:16 +02:00