diff --git a/crates/agent_ui/src/config_options.rs b/crates/agent_ui/src/config_options.rs index df4eecaccd..ccb821f9b2 100644 --- a/crates/agent_ui/src/config_options.rs +++ b/crates/agent_ui/src/config_options.rs @@ -581,6 +581,7 @@ impl Render for ConfigOptionSelector { .label(option_name) .label_position(SwitchLabelPosition::Start) .label_size(LabelSize::Small) + .label_color(Color::Muted) .disabled(self.setting_value) .on_click(move |state, _window, cx| { let next_value = matches!(state, ToggleState::Selected); diff --git a/crates/ui/src/components/toggle.rs b/crates/ui/src/components/toggle.rs index 9991b92ce3..236eda9690 100644 --- a/crates/ui/src/components/toggle.rs +++ b/crates/ui/src/components/toggle.rs @@ -343,6 +343,7 @@ pub struct Switch { label: Option, label_position: Option, label_size: LabelSize, + label_color: Color, full_width: bool, key_binding: Option, color: SwitchColor, @@ -362,6 +363,7 @@ impl Switch { label: None, label_position: None, label_size: LabelSize::Small, + label_color: Color::Default, full_width: false, key_binding: None, color: SwitchColor::default(), @@ -411,6 +413,11 @@ impl Switch { self } + pub fn label_color(mut self, color: Color) -> Self { + self.label_color = color; + self + } + pub fn full_width(mut self, full_width: bool) -> Self { self.full_width = full_width; self @@ -543,7 +550,11 @@ impl RenderOnce for Switch { self.label_position == Some(SwitchLabelPosition::Start), |this| { this.when_some(label.clone(), |this, label| { - this.child(Label::new(label).size(self.label_size)) + this.child( + Label::new(label) + .size(self.label_size) + .color(self.label_color), + ) }) }, ) @@ -552,7 +563,11 @@ impl RenderOnce for Switch { self.label_position == Some(SwitchLabelPosition::End), |this| { this.when_some(label, |this, label| { - this.child(Label::new(label).size(self.label_size)) + this.child( + Label::new(label) + .size(self.label_size) + .color(self.label_color), + ) }) }, )