parent
4ded78ed30
commit
d92e3a3222
6 changed files with 8 additions and 8 deletions
|
|
@ -94,7 +94,7 @@ impl Panel for ContainerPanel {
|
||||||
"ContainerPanel"
|
"ContainerPanel"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn title(&mut self, window: &Window, cx: &mut Context<Self>) -> AnyElement {
|
fn title(&mut self, window: &mut Window, cx: &mut Context<Self>) -> AnyElement {
|
||||||
self.panel.title(window, cx)
|
self.panel.title(window, cx)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -692,7 +692,7 @@ impl Panel for StoryContainer {
|
||||||
"StoryContainer"
|
"StoryContainer"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn title(&mut self, _window: &Window, _cx: &mut Context<Self>) -> AnyElement {
|
fn title(&mut self, _window: &mut Window, _cx: &mut Context<Self>) -> AnyElement {
|
||||||
self.name.clone().into_any_element()
|
self.name.clone().into_any_element()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ pub trait Panel: EventEmitter<PanelEvent> + Render + Focusable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The title of the panel
|
/// The title of the panel
|
||||||
fn title(&mut self, window: &Window, cx: &mut Context<Self>) -> AnyElement {
|
fn title(&mut self, window: &mut Window, cx: &mut Context<Self>) -> AnyElement {
|
||||||
SharedString::from(t!("Dock.Unnamed")).into_any_element()
|
SharedString::from(t!("Dock.Unnamed")).into_any_element()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -165,7 +165,7 @@ pub trait PanelView: 'static + Send + Sync {
|
||||||
fn panel_name(&self, cx: &App) -> &'static str;
|
fn panel_name(&self, cx: &App) -> &'static str;
|
||||||
fn panel_id(&self, cx: &App) -> EntityId;
|
fn panel_id(&self, cx: &App) -> EntityId;
|
||||||
fn tab_name(&self, cx: &App) -> Option<SharedString>;
|
fn tab_name(&self, cx: &App) -> Option<SharedString>;
|
||||||
fn title(&self, window: &Window, cx: &mut App) -> AnyElement;
|
fn title(&self, window: &mut Window, cx: &mut App) -> AnyElement;
|
||||||
fn title_suffix(&self, window: &mut Window, cx: &mut App) -> Option<AnyElement>;
|
fn title_suffix(&self, window: &mut Window, cx: &mut App) -> Option<AnyElement>;
|
||||||
fn title_style(&self, cx: &App) -> Option<TitleStyle>;
|
fn title_style(&self, cx: &App) -> Option<TitleStyle>;
|
||||||
fn closable(&self, cx: &App) -> bool;
|
fn closable(&self, cx: &App) -> bool;
|
||||||
|
|
@ -196,7 +196,7 @@ impl<T: Panel> PanelView for Entity<T> {
|
||||||
self.read(cx).tab_name(cx)
|
self.read(cx).tab_name(cx)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn title(&self, window: &Window, cx: &mut App) -> AnyElement {
|
fn title(&self, window: &mut Window, cx: &mut App) -> AnyElement {
|
||||||
self.update(cx, |this, cx| this.title(window, cx))
|
self.update(cx, |this, cx| this.title(window, cx))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ impl Panel for StackPanel {
|
||||||
"StackPanel"
|
"StackPanel"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn title(&mut self, _window: &gpui::Window, _cx: &mut Context<Self>) -> gpui::AnyElement {
|
fn title(&mut self, _window: &mut Window, _cx: &mut Context<Self>) -> gpui::AnyElement {
|
||||||
"StackPanel".into_any_element()
|
"StackPanel".into_any_element()
|
||||||
}
|
}
|
||||||
fn set_active(&mut self, active: bool, window: &mut Window, cx: &mut Context<Self>) {
|
fn set_active(&mut self, active: bool, window: &mut Window, cx: &mut Context<Self>) {
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ impl Panel for TabPanel {
|
||||||
"TabPanel"
|
"TabPanel"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn title(&mut self, window: &Window, cx: &mut Context<Self>) -> gpui::AnyElement {
|
fn title(&mut self, window: &mut Window, cx: &mut Context<Self>) -> gpui::AnyElement {
|
||||||
self.active_panel(cx)
|
self.active_panel(cx)
|
||||||
.map(|panel| panel.title(window, cx))
|
.map(|panel| panel.title(window, cx))
|
||||||
.unwrap_or("Empty Tab".into_any_element())
|
.unwrap_or("Empty Tab".into_any_element())
|
||||||
|
|
|
||||||
|
|
@ -148,7 +148,7 @@ impl Panel for Tiles {
|
||||||
"Tiles"
|
"Tiles"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn title(&mut self, _window: &Window, _cx: &mut Context<Self>) -> AnyElement {
|
fn title(&mut self, _window: &mut Window, _cx: &mut Context<Self>) -> AnyElement {
|
||||||
"Tiles".into_any_element()
|
"Tiles".into_any_element()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue