Add settings for removing the assistant and collaboration panel buttons

Add a not-logged-in state to the collaboration panel

co-authored-by: max <max@zed.dev>
This commit is contained in:
Mikayla 2023-08-07 16:27:47 -07:00
parent e37e76fc0b
commit 8980a9f1c1
No known key found for this signature in database
10 changed files with 195 additions and 115 deletions

View file

@ -192,6 +192,7 @@ impl AssistantPanel {
old_dock_position = new_dock_position;
cx.emit(AssistantPanelEvent::DockPositionChanged);
}
cx.notify();
})];
this
@ -790,8 +791,10 @@ impl Panel for AssistantPanel {
}
}
fn icon_path(&self) -> &'static str {
"icons/robot_14.svg"
fn icon_path(&self, cx: &WindowContext) -> Option<&'static str> {
settings::get::<AssistantSettings>(cx)
.button
.then(|| "icons/robot_14.svg")
}
fn icon_tooltip(&self) -> (String, Option<Box<dyn Action>>) {

View file

@ -13,6 +13,7 @@ pub enum AssistantDockPosition {
#[derive(Deserialize, Debug)]
pub struct AssistantSettings {
pub button: bool,
pub dock: AssistantDockPosition,
pub default_width: f32,
pub default_height: f32,
@ -20,6 +21,7 @@ pub struct AssistantSettings {
#[derive(Clone, Default, Serialize, Deserialize, JsonSchema, Debug)]
pub struct AssistantSettingsContent {
pub button: Option<bool>,
pub dock: Option<AssistantDockPosition>,
pub default_width: Option<f32>,
pub default_height: Option<f32>,