From d92e3a3222637d4def15c036d316843687a28ba7 Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Mon, 1 Dec 2025 18:03:29 +0800 Subject: [PATCH] dock: Fix title method missed thing in PR #1716 (#1718) Continue #1716 --- crates/story/examples/tiles.rs | 2 +- crates/story/src/lib.rs | 2 +- crates/ui/src/dock/panel.rs | 6 +++--- crates/ui/src/dock/stack_panel.rs | 2 +- crates/ui/src/dock/tab_panel.rs | 2 +- crates/ui/src/dock/tiles.rs | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/story/examples/tiles.rs b/crates/story/examples/tiles.rs index 232cc3c4..d4c257ba 100644 --- a/crates/story/examples/tiles.rs +++ b/crates/story/examples/tiles.rs @@ -94,7 +94,7 @@ impl Panel for ContainerPanel { "ContainerPanel" } - fn title(&mut self, window: &Window, cx: &mut Context) -> AnyElement { + fn title(&mut self, window: &mut Window, cx: &mut Context) -> AnyElement { self.panel.title(window, cx) } diff --git a/crates/story/src/lib.rs b/crates/story/src/lib.rs index b61a2b29..5cfcf982 100644 --- a/crates/story/src/lib.rs +++ b/crates/story/src/lib.rs @@ -692,7 +692,7 @@ impl Panel for StoryContainer { "StoryContainer" } - fn title(&mut self, _window: &Window, _cx: &mut Context) -> AnyElement { + fn title(&mut self, _window: &mut Window, _cx: &mut Context) -> AnyElement { self.name.clone().into_any_element() } diff --git a/crates/ui/src/dock/panel.rs b/crates/ui/src/dock/panel.rs index e21baaaf..019c2f70 100644 --- a/crates/ui/src/dock/panel.rs +++ b/crates/ui/src/dock/panel.rs @@ -66,7 +66,7 @@ pub trait Panel: EventEmitter + Render + Focusable { } /// The title of the panel - fn title(&mut self, window: &Window, cx: &mut Context) -> AnyElement { + fn title(&mut self, window: &mut Window, cx: &mut Context) -> 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; - 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; fn title_style(&self, cx: &App) -> Option; fn closable(&self, cx: &App) -> bool; @@ -196,7 +196,7 @@ impl PanelView for Entity { 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)) } diff --git a/crates/ui/src/dock/stack_panel.rs b/crates/ui/src/dock/stack_panel.rs index bc2b6149..a9ecb5f3 100644 --- a/crates/ui/src/dock/stack_panel.rs +++ b/crates/ui/src/dock/stack_panel.rs @@ -32,7 +32,7 @@ impl Panel for StackPanel { "StackPanel" } - fn title(&mut self, _window: &gpui::Window, _cx: &mut Context) -> gpui::AnyElement { + fn title(&mut self, _window: &mut Window, _cx: &mut Context) -> gpui::AnyElement { "StackPanel".into_any_element() } fn set_active(&mut self, active: bool, window: &mut Window, cx: &mut Context) { diff --git a/crates/ui/src/dock/tab_panel.rs b/crates/ui/src/dock/tab_panel.rs index e6766ad3..e4576f43 100644 --- a/crates/ui/src/dock/tab_panel.rs +++ b/crates/ui/src/dock/tab_panel.rs @@ -91,7 +91,7 @@ impl Panel for TabPanel { "TabPanel" } - fn title(&mut self, window: &Window, cx: &mut Context) -> gpui::AnyElement { + fn title(&mut self, window: &mut Window, cx: &mut Context) -> gpui::AnyElement { self.active_panel(cx) .map(|panel| panel.title(window, cx)) .unwrap_or("Empty Tab".into_any_element()) diff --git a/crates/ui/src/dock/tiles.rs b/crates/ui/src/dock/tiles.rs index 7217ed66..6e11606e 100644 --- a/crates/ui/src/dock/tiles.rs +++ b/crates/ui/src/dock/tiles.rs @@ -148,7 +148,7 @@ impl Panel for Tiles { "Tiles" } - fn title(&mut self, _window: &Window, _cx: &mut Context) -> AnyElement { + fn title(&mut self, _window: &mut Window, _cx: &mut Context) -> AnyElement { "Tiles".into_any_element() }