Ensure disable_ai
is properly respected (#34941)
Quick follow up to #34896 which ensures that the Agent Panel cannot be caught by actions like `workspace: toggle left dock` when `disable_ai` is set to true. Also removes a method that was introduced but unused in the workspace because `first_enabled_panel_idx` already covers all cases this method could be useful for. Release Notes: - N/A
This commit is contained in:
parent
c2c2264a60
commit
2bc6e18ac9
2 changed files with 3 additions and 12 deletions
|
@ -1,5 +1,5 @@
|
|||
use std::cell::RefCell;
|
||||
use std::ops::Range;
|
||||
use std::ops::{Not, Range};
|
||||
use std::path::Path;
|
||||
use std::rc::Rc;
|
||||
use std::sync::Arc;
|
||||
|
@ -1666,10 +1666,7 @@ impl Panel for AgentPanel {
|
|||
}
|
||||
|
||||
fn icon(&self, _window: &Window, cx: &App) -> Option<IconName> {
|
||||
(self.enabled(cx)
|
||||
&& AgentSettings::get_global(cx).button
|
||||
&& !DisableAiSettings::get_global(cx).disable_ai)
|
||||
.then_some(IconName::ZedAssistant)
|
||||
(self.enabled(cx) && AgentSettings::get_global(cx).button).then_some(IconName::ZedAssistant)
|
||||
}
|
||||
|
||||
fn icon_tooltip(&self, _window: &Window, _cx: &App) -> Option<&'static str> {
|
||||
|
@ -1685,7 +1682,7 @@ impl Panel for AgentPanel {
|
|||
}
|
||||
|
||||
fn enabled(&self, cx: &App) -> bool {
|
||||
AgentSettings::get_global(cx).enabled
|
||||
DisableAiSettings::get_global(cx).disable_ai.not() && AgentSettings::get_global(cx).enabled
|
||||
}
|
||||
|
||||
fn is_zoomed(&self, _window: &Window, _cx: &App) -> bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue