From d13c1486dab44094ac29e47a4ff9e1cb74bedc9e Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Fri, 15 Dec 2023 12:09:06 -0500 Subject: [PATCH 1/4] Update fold_indicator render --- crates/editor2/src/editor.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/editor2/src/editor.rs b/crates/editor2/src/editor.rs index 664d1d7380..3dd703bcba 100644 --- a/crates/editor2/src/editor.rs +++ b/crates/editor2/src/editor.rs @@ -4260,11 +4260,7 @@ impl Editor { fold_data .map(|(fold_status, buffer_row, active)| { (active || gutter_hovered || fold_status == FoldStatus::Folded).then(|| { - let icon = match fold_status { - FoldStatus::Folded => ui::Icon::ChevronRight, - FoldStatus::Foldable => ui::Icon::ChevronDown, - }; - IconButton::new(ix as usize, icon) + IconButton::new(ix as usize, ui::Icon::ChevronDown) .on_click(cx.listener(move |editor, e, cx| match fold_status { FoldStatus::Folded => { editor.unfold_at(&UnfoldAt { buffer_row }, cx); @@ -4274,6 +4270,10 @@ impl Editor { } })) .icon_color(ui::Color::Muted) + .icon_size(ui::IconSize::Small) + .selected(fold_status == FoldStatus::Folded) + .selected_icon(ui::Icon::ChevronRight) + .size(ui::ButtonSize::None) }) }) .flatten() From 83525bf142eebf5af1f69a4a02946475d5796090 Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Fri, 15 Dec 2023 12:22:33 -0500 Subject: [PATCH 2/4] Revert change to single line editor height --- crates/editor2/src/editor.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/editor2/src/editor.rs b/crates/editor2/src/editor.rs index 3dd703bcba..fc03150fb6 100644 --- a/crates/editor2/src/editor.rs +++ b/crates/editor2/src/editor.rs @@ -9303,7 +9303,7 @@ impl Render for Editor { font_size: rems(0.875).into(), font_weight: FontWeight::NORMAL, font_style: FontStyle::Normal, - line_height: relative(1.).into(), + line_height: relative(settings.buffer_line_height.value()), background_color: None, underline: None, white_space: WhiteSpace::Normal, From 4cb0f60779d5deb53ff782ea929e1b0b16d123e4 Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Fri, 15 Dec 2023 12:29:33 -0500 Subject: [PATCH 3/4] Update size of code action indicator and show when active --- crates/editor2/src/editor.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/crates/editor2/src/editor.rs b/crates/editor2/src/editor.rs index fc03150fb6..e1e4c7e0ad 100644 --- a/crates/editor2/src/editor.rs +++ b/crates/editor2/src/editor.rs @@ -4228,16 +4228,18 @@ impl Editor { ) -> Option { if self.available_code_actions.is_some() { Some( - IconButton::new("code_actions_indicator", ui::Icon::Bolt).on_click(cx.listener( - |editor, e, cx| { + IconButton::new("code_actions_indicator", ui::Icon::Bolt) + .icon_size(IconSize::Small) + .icon_color(Color::Muted) + .selected(is_active) + .on_click(cx.listener(|editor, e, cx| { editor.toggle_code_actions( &ToggleCodeActions { deployed_from_indicator: true, }, cx, ); - }, - )), + })), ) } else { None From e71f2b49e8a97dd269a045cdf66d9aae5eef2f5e Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Fri, 15 Dec 2023 15:41:53 -0500 Subject: [PATCH 4/4] Style fold control --- crates/editor2/src/element.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/editor2/src/element.rs b/crates/editor2/src/element.rs index a6d4bc20b1..20012ae41d 100644 --- a/crates/editor2/src/element.rs +++ b/crates/editor2/src/element.rs @@ -939,11 +939,11 @@ impl EditorElement { cx, |fold_element_state, cx| { if fold_element_state.is_active() { - gpui::blue() + cx.theme().colors().ghost_element_active } else if fold_bounds.contains(&cx.mouse_position()) { - gpui::black() + cx.theme().colors().ghost_element_hover } else { - gpui::red() + cx.theme().colors().ghost_element_background } }, )