diff --git a/crates/agent_ui/src/threads_panel.rs b/crates/agent_ui/src/threads_panel.rs index 66c7caadb121ae080af29cdab634a608ddc8da61..2afae504f7a4225badb58f28f9fb5433d99eb5f8 100644 --- a/crates/agent_ui/src/threads_panel.rs +++ b/crates/agent_ui/src/threads_panel.rs @@ -2183,7 +2183,7 @@ impl Panel for ThreadsPanel { self.set_width(size, cx); } - fn icon_button(&self, _window: &Window, _cx: &App) -> PanelIconButton { + fn icon_button(&self, _cx: &App) -> PanelIconButton { PanelIconButton { icon: IconName::ThreadsSidebarLeftClosed, tooltip: "Threads Sidebar", @@ -2191,7 +2191,7 @@ impl Panel for ThreadsPanel { } } - fn secondary_button(&self, _window: &Window, cx: &App) -> Option<(PanelIconButton, bool)> { + fn secondary_button(&self, cx: &App) -> Option<(PanelIconButton, bool)> { let is_active = self .multi_workspace .read_with(cx, |mw, cx| { diff --git a/crates/collab_ui/src/collab_panel.rs b/crates/collab_ui/src/collab_panel.rs index f88d9d450cc8560fa4fb19a2ab0f8e5c1be6478b..b9a369661c852171e1d0eeee86a9705788446f2c 100644 --- a/crates/collab_ui/src/collab_panel.rs +++ b/crates/collab_ui/src/collab_panel.rs @@ -3191,7 +3191,7 @@ impl Panel for CollabPanel { }); } - fn icon_button(&self, _window: &Window, _cx: &App) -> PanelIconButton { + fn icon_button(&self, _cx: &App) -> PanelIconButton { PanelIconButton { icon: ui::IconName::UserGroup, tooltip: "Collab Panel", diff --git a/crates/collab_ui/src/notification_panel.rs b/crates/collab_ui/src/notification_panel.rs index bf4baa5074b4b65720f6cc42335a9743271080d1..c85d98a71cf373a5ab1f3bbf50bb2e0f3f02cc56 100644 --- a/crates/collab_ui/src/notification_panel.rs +++ b/crates/collab_ui/src/notification_panel.rs @@ -659,7 +659,7 @@ impl Panel for NotificationPanel { } } - fn icon_button(&self, _window: &Window, _cx: &App) -> PanelIconButton { + fn icon_button(&self, _cx: &App) -> PanelIconButton { PanelIconButton { icon: if self.unseen_notifications.is_empty() { IconName::Bell @@ -671,7 +671,7 @@ impl Panel for NotificationPanel { } } - fn icon_label(&self, _window: &Window, cx: &App) -> Option { + fn icon_label(&self, cx: &App) -> Option { if !NotificationPanelSettings::get_global(cx).show_count_badge { return None; } diff --git a/crates/debugger_ui/src/debugger_panel.rs b/crates/debugger_ui/src/debugger_panel.rs index febe189b8b582d055617018899ad59fc4562be31..62bfdbe64c71ec80f303497c120fad4a5ffb47ad 100644 --- a/crates/debugger_ui/src/debugger_panel.rs +++ b/crates/debugger_ui/src/debugger_panel.rs @@ -1579,7 +1579,7 @@ impl Panel for DebugPanel { Some(proto::PanelId::DebugPanel) } - fn icon_button(&self, _window: &Window, _cx: &App) -> PanelIconButton { + fn icon_button(&self, _cx: &App) -> PanelIconButton { PanelIconButton { icon: IconName::Debug, tooltip: "Debug Panel", diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rs index a9350300dc5b4af1beca3a47914af8f568c9567e..9fd4b8ee00c63e340bfe144bcc7fcb44818ae95b 100644 --- a/crates/git_ui/src/git_panel.rs +++ b/crates/git_ui/src/git_panel.rs @@ -5789,7 +5789,7 @@ impl Panel for GitPanel { cx.notify(); } - fn icon_button(&self, _window: &Window, _cx: &App) -> PanelIconButton { + fn icon_button(&self, _cx: &App) -> PanelIconButton { PanelIconButton { icon: ui::IconName::GitBranchAlt, tooltip: "Git Panel", @@ -5801,7 +5801,7 @@ impl Panel for GitPanel { GitPanelSettings::get_global(cx).button } - fn icon_label(&self, _: &Window, cx: &App) -> Option { + fn icon_label(&self, cx: &App) -> Option { if !GitPanelSettings::get_global(cx).show_count_badge { return None; } diff --git a/crates/outline_panel/src/outline_panel.rs b/crates/outline_panel/src/outline_panel.rs index ede30b6401b9d7c6ee39de8bdfc61b03b8105c67..589bff1327cc1774cc51bedd819a84f71f9c4e80 100644 --- a/crates/outline_panel/src/outline_panel.rs +++ b/crates/outline_panel/src/outline_panel.rs @@ -5017,7 +5017,7 @@ impl Panel for OutlinePanel { }); } - fn icon_button(&self, _window: &Window, _cx: &App) -> PanelIconButton { + fn icon_button(&self, _cx: &App) -> PanelIconButton { PanelIconButton { icon: IconName::ListTree, tooltip: "Outline Panel", diff --git a/crates/project_panel/src/project_panel.rs b/crates/project_panel/src/project_panel.rs index ad48fe2bdbf772938d21e1431193d31d47b4bcb1..c7dad9d665574afff6e3290e569effa27054e0c3 100644 --- a/crates/project_panel/src/project_panel.rs +++ b/crates/project_panel/src/project_panel.rs @@ -7057,7 +7057,7 @@ impl Panel for ProjectPanel { }); } - fn icon_button(&self, _window: &Window, _cx: &App) -> PanelIconButton { + fn icon_button(&self, _cx: &App) -> PanelIconButton { PanelIconButton { icon: IconName::FileTree, tooltip: "Project Panel", diff --git a/crates/terminal_view/src/terminal_panel.rs b/crates/terminal_view/src/terminal_panel.rs index f04dcce3f9eea1d687776f2c2425e5a937cd45cd..368266b67dba9de4b8a2e826b90cc8717cbd9183 100644 --- a/crates/terminal_view/src/terminal_panel.rs +++ b/crates/terminal_view/src/terminal_panel.rs @@ -1605,7 +1605,7 @@ impl Panel for TerminalPanel { }) } - fn icon_label(&self, _window: &Window, cx: &App) -> Option { + fn icon_label(&self, cx: &App) -> Option { if !TerminalSettings::get_global(cx).show_count_badge { return None; } @@ -1630,7 +1630,7 @@ impl Panel for TerminalPanel { TERMINAL_PANEL_KEY } - fn icon_button(&self, _window: &Window, _cx: &App) -> PanelIconButton { + fn icon_button(&self, _cx: &App) -> PanelIconButton { PanelIconButton { icon: IconName::TerminalAlt, tooltip: "Terminal Panel", diff --git a/crates/workspace/src/dock.rs b/crates/workspace/src/dock.rs index 4410f877ed766836fe8861cf77a4bf24567638c6..11ebd3870821fcef52c886b04e4ff96afa2b5301 100644 --- a/crates/workspace/src/dock.rs +++ b/crates/workspace/src/dock.rs @@ -42,11 +42,11 @@ pub trait Panel: Focusable + EventEmitter + Render + Sized { fn set_position(&mut self, position: DockPosition, window: &mut Window, cx: &mut Context); fn size(&self, window: &Window, cx: &App) -> Pixels; fn set_size(&mut self, size: Option, window: &mut Window, cx: &mut Context); - fn icon_button(&self, window: &Window, cx: &App) -> PanelIconButton; - fn icon_label(&self, _: &Window, _: &App) -> Option { + fn icon_button(&self, cx: &App) -> PanelIconButton; + fn icon_label(&self, _: &App) -> Option { None } - fn secondary_button(&self, _window: &Window, _cx: &App) -> Option<(PanelIconButton, bool)> { + fn secondary_button(&self, _cx: &App) -> Option<(PanelIconButton, bool)> { None } fn is_zoomed(&self, _window: &Window, _cx: &App) -> bool { @@ -83,9 +83,9 @@ pub trait PanelHandle: Send + Sync { fn pane(&self, cx: &App) -> Option>; fn size(&self, window: &Window, cx: &App) -> Pixels; fn set_size(&self, size: Option, window: &mut Window, cx: &mut App); - fn icon_button(&self, window: &Window, cx: &App) -> PanelIconButton; - fn icon_label(&self, _: &Window, _: &App) -> Option; - fn secondary_button(&self, window: &Window, cx: &App) -> Option<(PanelIconButton, bool)>; + fn icon_button(&self, cx: &App) -> PanelIconButton; + fn icon_label(&self, _: &App) -> Option; + fn secondary_button(&self, cx: &App) -> Option<(PanelIconButton, bool)>; fn panel_focus_handle(&self, cx: &App) -> FocusHandle; fn to_any(&self) -> AnyView; fn activation_priority(&self, cx: &App) -> u32; @@ -171,16 +171,16 @@ where self.update(cx, |this, cx| this.set_size(size, window, cx)) } - fn icon_button(&self, window: &Window, cx: &App) -> PanelIconButton { - self.read(cx).icon_button(window, cx) + fn icon_button(&self, cx: &App) -> PanelIconButton { + self.read(cx).icon_button(cx) } - fn icon_label(&self, window: &Window, cx: &App) -> Option { - self.read(cx).icon_label(window, cx) + fn icon_label(&self, cx: &App) -> Option { + self.read(cx).icon_label(cx) } - fn secondary_button(&self, window: &Window, cx: &App) -> Option<(PanelIconButton, bool)> { - self.read(cx).secondary_button(window, cx) + fn secondary_button(&self, cx: &App) -> Option<(PanelIconButton, bool)> { + self.read(cx).secondary_button(cx) } fn to_any(&self) -> AnyView { @@ -882,7 +882,7 @@ impl PanelButtons { } impl Render for PanelButtons { - fn render(&mut self, window: &mut Window, cx: &mut Context) -> impl IntoElement { + fn render(&mut self, _window: &mut Window, cx: &mut Context) -> impl IntoElement { let dock = self.dock.read(cx); let active_index = dock.active_panel_index; let is_open = dock.is_open; @@ -905,8 +905,8 @@ impl Render for PanelButtons { icon, tooltip: icon_tooltip, action: toggle_action, - } = entry.panel.icon_button(window, cx); - let secondary_button = entry.panel.secondary_button(window, cx); + } = entry.panel.icon_button(cx); + let secondary_button = entry.panel.secondary_button(cx); let name = entry.panel.persistent_name(); let panel = entry.panel.clone(); @@ -923,7 +923,7 @@ impl Render for PanelButtons { }; let focus_handle = dock.focus_handle(cx); - let icon_label = entry.panel.icon_label(window, cx); + let icon_label = entry.panel.icon_label(cx); Some( right_click_menu(name) @@ -1118,7 +1118,7 @@ pub mod test { self.size = size.unwrap_or(px(300.)); } - fn icon_button(&self, _window: &Window, _cx: &App) -> PanelIconButton { + fn icon_button(&self, _cx: &App) -> PanelIconButton { PanelIconButton { icon: ui::IconName::Cog, tooltip: "Test Panel",