Refactor GoToLine to use cx.observe_new_views()

This commit is contained in:
Conrad Irwin 2023-11-08 16:23:05 -07:00
parent cbdd4aca89
commit 1b9f76c01d
11 changed files with 136 additions and 65 deletions

View file

@ -1,6 +1,7 @@
use crate::ItemHandle;
use gpui::{
AnyView, AppContext, Entity, EntityId, EventEmitter, Render, View, ViewContext, WindowContext,
AnyView, AppContext, Div, Entity, EntityId, EventEmitter, Render, View, ViewContext,
WindowContext,
};
pub trait ToolbarItemView: Render + EventEmitter {
@ -56,6 +57,14 @@ pub struct Toolbar {
items: Vec<(Box<dyn ToolbarItemViewHandle>, ToolbarItemLocation)>,
}
impl Render for Toolbar {
type Element = Div<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
todo!()
}
}
// todo!()
// impl View for Toolbar {
// fn ui_name() -> &'static str {