From f75f96f135fb8102317296d2f9b037aa6539c0c4 Mon Sep 17 00:00:00 2001 From: Floyd Wang Date: Tue, 25 Feb 2025 14:15:42 +0800 Subject: [PATCH] dock: Panel trait `set_active` with mutable window and cx (#659) --- crates/story/src/lib.rs | 2 +- crates/ui/src/dock/panel.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/story/src/lib.rs b/crates/story/src/lib.rs index 0dd0f5a6..b2e6b782 100644 --- a/crates/story/src/lib.rs +++ b/crates/story/src/lib.rs @@ -472,7 +472,7 @@ impl Panel for StoryContainer { println!("panel: {} zoomed: {}", self.name, zoomed); } - fn set_active(&mut self, active: bool, _window: &Window, _cx: &App) { + fn set_active(&mut self, active: bool, _window: &mut Window, _cx: &mut App) { println!("panel: {} active: {}", self.name, active); } diff --git a/crates/ui/src/dock/panel.rs b/crates/ui/src/dock/panel.rs index d29d46eb..78c72fbe 100644 --- a/crates/ui/src/dock/panel.rs +++ b/crates/ui/src/dock/panel.rs @@ -95,7 +95,7 @@ pub trait Panel: EventEmitter + Render + Focusable { /// This method will be called when the panel is active or inactive. /// /// The last_active_panel and current_active_panel will be touched when the panel is active. - fn set_active(&mut self, active: bool, window: &Window, cx: &App) {} + fn set_active(&mut self, active: bool, window: &mut Window, cx: &mut App) {} /// Set zoomed state of the panel. ///