dock: Add mutable reference for set_active (#655)

This commit is contained in:
Floyd Wang 2025-02-25 11:46:54 +08:00 committed by GitHub
parent 3b4065ce4e
commit 9739493bce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 3 deletions

View file

@ -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);
}

View file

@ -95,8 +95,7 @@ pub trait Panel: EventEmitter<PanelEvent> + 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.
///