dock: Fix title method missed thing in PR #1716 (#1718)

Continue #1716
This commit is contained in:
Jason Lee 2025-12-01 18:03:29 +08:00 committed by GitHub
parent 4ded78ed30
commit d92e3a3222
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 8 additions and 8 deletions

View file

@ -94,7 +94,7 @@ impl Panel for 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)
}

View file

@ -692,7 +692,7 @@ impl Panel for 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()
}

View file

@ -66,7 +66,7 @@ pub trait Panel: EventEmitter<PanelEvent> + Render + Focusable {
}
/// 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()
}
@ -165,7 +165,7 @@ pub trait PanelView: 'static + Send + Sync {
fn panel_name(&self, cx: &App) -> &'static str;
fn panel_id(&self, cx: &App) -> EntityId;
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_style(&self, cx: &App) -> Option<TitleStyle>;
fn closable(&self, cx: &App) -> bool;
@ -196,7 +196,7 @@ impl<T: Panel> PanelView for Entity<T> {
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))
}

View file

@ -32,7 +32,7 @@ impl Panel for 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()
}
fn set_active(&mut self, active: bool, window: &mut Window, cx: &mut Context<Self>) {

View file

@ -91,7 +91,7 @@ impl Panel for 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)
.map(|panel| panel.title(window, cx))
.unwrap_or("Empty Tab".into_any_element())

View file

@ -148,7 +148,7 @@ impl Panel for 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()
}