Update size of code action indicator and show when active

This commit is contained in:
Nate Butler 2023-12-15 12:29:33 -05:00
parent 83525bf142
commit 4cb0f60779

View file

@ -4228,16 +4228,18 @@ impl Editor {
) -> Option<IconButton> { ) -> Option<IconButton> {
if self.available_code_actions.is_some() { if self.available_code_actions.is_some() {
Some( Some(
IconButton::new("code_actions_indicator", ui::Icon::Bolt).on_click(cx.listener( IconButton::new("code_actions_indicator", ui::Icon::Bolt)
|editor, e, cx| { .icon_size(IconSize::Small)
.icon_color(Color::Muted)
.selected(is_active)
.on_click(cx.listener(|editor, e, cx| {
editor.toggle_code_actions( editor.toggle_code_actions(
&ToggleCodeActions { &ToggleCodeActions {
deployed_from_indicator: true, deployed_from_indicator: true,
}, },
cx, cx,
); );
}, })),
)),
) )
} else { } else {
None None