wip: refactor

This commit is contained in:
reya
2025-02-01 09:07:01 +07:00
parent a61fd27b9d
commit 944d3b9e46
5 changed files with 96 additions and 81 deletions
+8 -8
View File
@@ -5,7 +5,6 @@ use gpui::{
div, img, percentage, prelude::FluentBuilder, px, Context, InteractiveElement, IntoElement,
ParentElement, Render, SharedString, StatefulInteractiveElement, Styled, Window,
};
use std::sync::Arc;
use ui::{
dock_area::dock::DockPlacement,
skeleton::Skeleton,
@@ -103,13 +102,14 @@ impl Inbox {
}
}
fn action(&self, id: u64, _window: &mut Window, cx: &mut Context<Self>) {
let action = AddPanel {
panel: PanelKind::Room(id),
position: DockPlacement::Center,
};
cx.dispatch_action(&action)
fn action(&self, id: u64, window: &mut Window, cx: &mut Context<Self>) {
window.dispatch_action(
Box::new(AddPanel {
panel: PanelKind::Room(id),
position: DockPlacement::Center,
}),
cx,
);
}
}