Switch action dispatch to use MutableAppContext parent utilities and delete parent map from presenter

This commit is contained in:
K Simmons 2022-08-05 12:38:05 -07:00
parent 4271eb3624
commit 6442ec59e7
6 changed files with 100 additions and 52 deletions

View file

@ -441,6 +441,7 @@ impl Pane {
pane.active_item_index = usize::MAX;
};
cx.reparent(&item);
pane.items.insert(item_ix, item);
pane.activate_item(item_ix, activate_pane, focus_item, false, cx);
cx.notify();

View file

@ -140,6 +140,7 @@ impl Sidebar {
}
}),
];
cx.reparent(&view);
self.items.push(Item {
icon_path,
tooltip,

View file

@ -81,6 +81,7 @@ impl StatusBar {
where
T: 'static + StatusItemView,
{
cx.reparent(&item);
self.left_items.push(Box::new(item));
cx.notify();
}
@ -89,6 +90,7 @@ impl StatusBar {
where
T: 'static + StatusItemView,
{
cx.reparent(&item);
self.right_items.push(Box::new(item));
cx.notify();
}

View file

@ -708,6 +708,12 @@ impl Into<AnyViewHandle> for Box<dyn ItemHandle> {
}
}
impl Into<AnyViewHandle> for &Box<dyn ItemHandle> {
fn into(self) -> AnyViewHandle {
self.to_any()
}
}
impl Clone for Box<dyn ItemHandle> {
fn clone(&self) -> Box<dyn ItemHandle> {
self.boxed_clone()