Editor UI Cleanup (#3676)
[[PR Description]]
TODO:
- [x] Style fold marker
- [x] Editor - Code action icon too large, should use muted color,
should have tooltip
- [ ] Style inline assistant
- Prompt text gets cut off veritcally
- [x] Line height on inline assist editor isn't tall enough
- Nate: This is my fault due to the line height (relative: 1) we are
setting on non-buffer editors. I'll look into this.
- [ ] Style diagnostic hover (right now it's an opaque box on some
themes)
- Nate: This needs status tints, we are working on it
- [ ] Hovering over a symbol shows a dialogue that appears underneath
the scroll-bar
Release Notes:
- N/A
This commit is contained in:
@@ -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
|
||||||
@@ -4260,11 +4262,7 @@ impl Editor {
|
|||||||
fold_data
|
fold_data
|
||||||
.map(|(fold_status, buffer_row, active)| {
|
.map(|(fold_status, buffer_row, active)| {
|
||||||
(active || gutter_hovered || fold_status == FoldStatus::Folded).then(|| {
|
(active || gutter_hovered || fold_status == FoldStatus::Folded).then(|| {
|
||||||
let icon = match fold_status {
|
IconButton::new(ix as usize, ui::Icon::ChevronDown)
|
||||||
FoldStatus::Folded => ui::Icon::ChevronRight,
|
|
||||||
FoldStatus::Foldable => ui::Icon::ChevronDown,
|
|
||||||
};
|
|
||||||
IconButton::new(ix as usize, icon)
|
|
||||||
.on_click(cx.listener(move |editor, e, cx| match fold_status {
|
.on_click(cx.listener(move |editor, e, cx| match fold_status {
|
||||||
FoldStatus::Folded => {
|
FoldStatus::Folded => {
|
||||||
editor.unfold_at(&UnfoldAt { buffer_row }, cx);
|
editor.unfold_at(&UnfoldAt { buffer_row }, cx);
|
||||||
@@ -4274,6 +4272,10 @@ impl Editor {
|
|||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
.icon_color(ui::Color::Muted)
|
.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()
|
.flatten()
|
||||||
@@ -9303,7 +9305,7 @@ impl Render for Editor {
|
|||||||
font_size: rems(0.875).into(),
|
font_size: rems(0.875).into(),
|
||||||
font_weight: FontWeight::NORMAL,
|
font_weight: FontWeight::NORMAL,
|
||||||
font_style: FontStyle::Normal,
|
font_style: FontStyle::Normal,
|
||||||
line_height: relative(1.).into(),
|
line_height: relative(settings.buffer_line_height.value()),
|
||||||
background_color: None,
|
background_color: None,
|
||||||
underline: None,
|
underline: None,
|
||||||
white_space: WhiteSpace::Normal,
|
white_space: WhiteSpace::Normal,
|
||||||
|
|||||||
@@ -939,11 +939,11 @@ impl EditorElement {
|
|||||||
cx,
|
cx,
|
||||||
|fold_element_state, cx| {
|
|fold_element_state, cx| {
|
||||||
if fold_element_state.is_active() {
|
if fold_element_state.is_active() {
|
||||||
gpui::blue()
|
cx.theme().colors().ghost_element_active
|
||||||
} else if fold_bounds.contains(&cx.mouse_position()) {
|
} else if fold_bounds.contains(&cx.mouse_position()) {
|
||||||
gpui::black()
|
cx.theme().colors().ghost_element_hover
|
||||||
} else {
|
} else {
|
||||||
gpui::red()
|
cx.theme().colors().ghost_element_background
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user