Add more open events

project search
diagnostics
welcome page
This commit is contained in:
Joseph T. Lyons 2024-01-15 16:26:04 -05:00
parent e2f08a6cca
commit ba9a9f4f17
13 changed files with 110 additions and 31 deletions

View file

@ -114,6 +114,8 @@ pub trait Item: FocusableView + EventEmitter<Self::Event> {
}
fn tab_content(&self, detail: Option<usize>, selected: bool, cx: &WindowContext) -> AnyElement;
fn telemetry_event_text(&self) -> Option<&'static str>;
/// (model id, Item)
fn for_each_project_item(
&self,
@ -225,6 +227,7 @@ pub trait ItemHandle: 'static + Send {
fn tab_tooltip_text(&self, cx: &AppContext) -> Option<SharedString>;
fn tab_description(&self, detail: usize, cx: &AppContext) -> Option<SharedString>;
fn tab_content(&self, detail: Option<usize>, selected: bool, cx: &WindowContext) -> AnyElement;
fn telemetry_event_text(&self, cx: &WindowContext) -> Option<&'static str>;
fn dragged_tab_content(&self, detail: Option<usize>, cx: &WindowContext) -> AnyElement;
fn project_path(&self, cx: &AppContext) -> Option<ProjectPath>;
fn project_entry_ids(&self, cx: &AppContext) -> SmallVec<[ProjectEntryId; 3]>;
@ -313,6 +316,10 @@ impl<T: Item> ItemHandle for View<T> {
self.read(cx).tab_tooltip_text(cx)
}
fn telemetry_event_text(&self, cx: &WindowContext) -> Option<&'static str> {
self.read(cx).telemetry_event_text()
}
fn tab_description(&self, detail: usize, cx: &AppContext) -> Option<SharedString> {
self.read(cx).tab_description(detail, cx)
}
@ -922,6 +929,10 @@ pub mod test {
})
}
fn telemetry_event_text(&self) -> Option<&'static str> {
None
}
fn tab_content(
&self,
detail: Option<usize>,