git_ui: Clean up the commit view UI (#44162)

This commit is contained in:
Danilo Leal
2025-12-04 13:44:48 -03:00
committed by GitHub
parent 93bc6616c6
commit c357dc25fc
3 changed files with 132 additions and 100 deletions
+5
View File
@@ -20090,6 +20090,11 @@ impl Editor {
self.show_indent_guides
}
pub fn disable_indent_guides(&mut self) -> Option<bool> {
self.show_indent_guides = Some(false);
self.show_indent_guides
}
pub fn toggle_line_numbers(
&mut self,
_: &ToggleLineNumbers,
+13 -9
View File
@@ -3915,6 +3915,8 @@ impl EditorElement {
) -> impl IntoElement {
let editor = self.editor.read(cx);
let multi_buffer = editor.buffer.read(cx);
let is_read_only = self.editor.read(cx).read_only(cx);
let file_status = multi_buffer
.all_diff_hunks_expanded()
.then(|| editor.status_for_buffer_id(for_excerpt.buffer_id, cx))
@@ -3967,7 +3969,7 @@ impl EditorElement {
.gap_1p5()
.when(is_sticky, |el| el.shadow_md())
.border_1()
.map(|div| {
.map(|border| {
let border_color = if is_selected
&& is_folded
&& focus_handle.contains_focused(window, cx)
@@ -3976,7 +3978,7 @@ impl EditorElement {
} else {
colors.border
};
div.border_color(border_color)
border.border_color(border_color)
})
.bg(colors.editor_subheader_background)
.hover(|style| style.bg(colors.element_hover))
@@ -4056,13 +4058,15 @@ impl EditorElement {
})
.take(1),
)
.child(
h_flex()
.size_3()
.justify_center()
.flex_shrink_0()
.children(indicator),
)
.when(!is_read_only, |this| {
this.child(
h_flex()
.size_3()
.justify_center()
.flex_shrink_0()
.children(indicator),
)
})
.child(
h_flex()
.cursor_pointer()