diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 9e5a6329bf3099f64c074acfa1483a0aa9836018..ce31e68dae5f6471488159d32e01964a80d8eb87 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -2737,7 +2737,7 @@ impl Editor { Some( MouseEventHandler::new::(0, cx, |_, _| { Svg::new("icons/bolt_8.svg") - .with_color(style.code_actions_indicator) + .with_color(style.code_actions.indicator) .boxed() }) .with_cursor_style(CursorStyle::PointingHand) diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rs index f6cc2796b14dbf5d85af41325ecbb21496c7ee3e..d9d0c3990cce3960d5c88749bf0a0aefe2609d13 100644 --- a/crates/editor/src/element.rs +++ b/crates/editor/src/element.rs @@ -1453,7 +1453,10 @@ impl Element for EditorElement { if let Some((_, indicator)) = code_actions_indicator.as_mut() { indicator.layout( - SizeConstraint::strict_along(Axis::Vertical, line_height * 0.618), + SizeConstraint::strict_along( + Axis::Vertical, + line_height * style.code_actions.vertical_scale, + ), cx, ); } diff --git a/crates/theme/src/theme.rs b/crates/theme/src/theme.rs index be89148985a1f453f89dcae03b770e79fa488b31..ff13a233144c762d692e38cb2f5e08fb85810b7a 100644 --- a/crates/theme/src/theme.rs +++ b/crates/theme/src/theme.rs @@ -480,7 +480,7 @@ pub struct Editor { pub hint_diagnostic: DiagnosticStyle, pub invalid_hint_diagnostic: DiagnosticStyle, pub autocomplete: AutocompleteStyle, - pub code_actions_indicator: Color, + pub code_actions: CodeActions, pub unnecessary_code_fade: f32, pub hover_popover: HoverPopover, pub link_definition: HighlightStyle, @@ -541,6 +541,13 @@ pub struct FieldEditor { pub selection: SelectionStyle, } +#[derive(Clone, Deserialize, Default)] +pub struct CodeActions { + #[serde(default)] + pub indicator: Color, + pub vertical_scale: f32, +} + #[derive(Debug, Default, Clone, Copy)] pub struct Interactive { pub default: T,