dock: Panel trait set_zoomed with mutable window and cx (#661)

Need Update panel functions to mutable `self`, `window` and `cx`.
This commit is contained in:
Floyd Wang 2025-02-25 14:34:49 +08:00
parent 9f429592ce
commit dc4d7e614c
2 changed files with 2 additions and 2 deletions

View file

@ -468,7 +468,7 @@ impl Panel for StoryContainer {
.contains(&self.name)
}
fn set_zoomed(&self, zoomed: bool, _window: &Window, _cx: &App) {
fn set_zoomed(&mut self, zoomed: bool, _window: &mut Window, _cx: &mut App) {
println!("panel: {} zoomed: {}", self.name, zoomed);
}

View file

@ -102,7 +102,7 @@ pub trait Panel: EventEmitter<PanelEvent> + Render + Focusable {
/// This method will be called when the panel is zoomed or unzoomed.
///
/// Only current Panel will touch this method.
fn set_zoomed(&self, zoomed: bool, window: &Window, cx: &App) {}
fn set_zoomed(&mut self, zoomed: bool, window: &mut Window, cx: &mut App) {}
/// The addition popup menu of the panel, default is `None`.
fn popup_menu(&self, this: PopupMenu, window: &Window, cx: &App) -> PopupMenu {