Merge branch 'main' into picker

This commit is contained in:
Mikayla Maki 2023-11-07 11:44:02 -08:00 committed by GitHub
commit a3bd04fed2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 187 additions and 49 deletions

View file

@ -28,10 +28,6 @@ struct ToggleModal {
name: String,
}
// complete change of plan?
// on_action(ToggleModal{ name})
// register_modal(name, |workspace, cx| { ... })
impl ModalRegistry {
pub fn register_modal<A: 'static, V, B>(&mut self, action: A, build_view: B)
where
@ -40,12 +36,10 @@ impl ModalRegistry {
{
let build_view = Arc::new(build_view);
dbg!("yonder");
self.registered_modals.push((
TypeId::of::<A>(),
Box::new(move |mut div| {
let build_view = build_view.clone();
dbg!("this point");
div.on_action(
move |workspace: &mut Workspace, event: &A, cx: &mut ViewContext<Workspace>| {
@ -67,9 +61,7 @@ impl ModalLayer {
Self { open_modal: None }
}
pub fn render(&self, cx: &ViewContext<Workspace>) -> impl Component<Workspace> {
dbg!("rendering ModalLayer");
pub fn render(&self, workspace: &Workspace, cx: &ViewContext<Workspace>) -> Div<Workspace> {
let mut div = div();
// div, c workspace.toggle_modal()div.on_action()) {