Allow actions to be deserialized from JSON

Introduce separate macro for implementing 'internal' actions which
are not intended to be loaded from keymaps.
This commit is contained in:
Max Brunsfeld 2022-04-08 15:32:56 -07:00
parent 1778622960
commit fd4b81c8fc
26 changed files with 559 additions and 335 deletions

View file

@ -4,7 +4,7 @@ use gpui::{
Align, ConstrainedBox, Empty, Flex, Label, MouseEventHandler, ParentElement, ScrollTarget,
Svg, UniformList, UniformListState,
},
impl_actions,
impl_internal_actions,
keymap::{self, Binding},
platform::CursorStyle,
AppContext, Element, ElementBox, Entity, ModelHandle, MutableAppContext, View, ViewContext,
@ -54,7 +54,7 @@ pub struct ToggleExpanded(pub ProjectEntryId);
pub struct Open(pub ProjectEntryId);
actions!(project_panel, [ExpandSelectedEntry, CollapseSelectedEntry]);
impl_actions!(project_panel, [Open, ToggleExpanded]);
impl_internal_actions!(project_panel, [Open, ToggleExpanded]);
pub fn init(cx: &mut MutableAppContext) {
cx.add_action(ProjectPanel::expand_selected_entry);