mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-07 19:19:12 +00:00
Use Workspace::view
to construct the view
This commit is contained in:
parent
79a61c28d7
commit
6e5ad75c5c
1 changed files with 5 additions and 5 deletions
|
@ -23,10 +23,6 @@ pub struct Workspace {
|
|||
bottom_panel_scroll_state: ScrollState,
|
||||
}
|
||||
|
||||
fn workspace(cx: &mut WindowContext) -> View<Workspace> {
|
||||
view(cx.entity(|cx| Workspace::new()), Workspace::render)
|
||||
}
|
||||
|
||||
impl Workspace {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
|
@ -109,6 +105,10 @@ impl Workspace {
|
|||
cx.notify();
|
||||
}
|
||||
|
||||
pub fn view(cx: &mut WindowContext) -> View<Self> {
|
||||
view(cx.entity(|cx| Self::new()), Self::render)
|
||||
}
|
||||
|
||||
pub fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element<ViewState = Self> {
|
||||
let theme = theme(cx).clone();
|
||||
|
||||
|
@ -285,7 +285,7 @@ mod stories {
|
|||
pub fn view(cx: &mut WindowContext) -> View<Self> {
|
||||
view(
|
||||
cx.entity(|cx| Self {
|
||||
workspace: workspace(cx),
|
||||
workspace: Workspace::view(cx),
|
||||
}),
|
||||
|view, cx| view.workspace.clone(),
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue