From 9739493bceac29b410693cea08f329e5d2366798 Mon Sep 17 00:00:00 2001 From: Floyd Wang Date: Tue, 25 Feb 2025 11:46:54 +0800 Subject: [PATCH] dock: Add mutable reference for `set_active` (#655) --- crates/story/src/lib.rs | 2 +- crates/ui/src/dock/panel.rs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/story/src/lib.rs b/crates/story/src/lib.rs index c13f562f..0dd0f5a6 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(&self, active: bool, _window: &Window, _cx: &App) { + fn set_active(&mut self, active: bool, _window: &Window, _cx: &App) { println!("panel: {} active: {}", self.name, active); } diff --git a/crates/ui/src/dock/panel.rs b/crates/ui/src/dock/panel.rs index 2b83e13c..d29d46eb 100644 --- a/crates/ui/src/dock/panel.rs +++ b/crates/ui/src/dock/panel.rs @@ -95,8 +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. - #[allow(unused_variables)] - fn set_active(&self, active: bool, window: &Window, cx: &App) {} + fn set_active(&mut self, active: bool, window: &Window, cx: &App) {} /// Set zoomed state of the panel. ///