From dc85378b9679253c03d5a11a8c5f0f3ae0d641d7 Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Thu, 3 Oct 2024 16:23:56 +0200 Subject: [PATCH] Clean up style properties on hunk controls (#18639) This PR removes some duplicate style properties on the hunk controls, namely padding, border, and background color. Release Notes: - N/A --- crates/editor/src/hunk_diff.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/crates/editor/src/hunk_diff.rs b/crates/editor/src/hunk_diff.rs index ff3451fc9216b0dbb8989d23a13c4df3dfd8c791..7fbb07ae35c79e694cc6775930912b36638918b5 100644 --- a/crates/editor/src/hunk_diff.rs +++ b/crates/editor/src/hunk_diff.rs @@ -379,6 +379,7 @@ impl Editor { }); let border_color = cx.theme().colors().border_variant; + let bg_color = cx.theme().colors().editor_background; let gutter_color = match hunk.status { DiffHunkStatus::Added => cx.theme().status().created, DiffHunkStatus::Modified => cx.theme().status().modified, @@ -394,6 +395,7 @@ impl Editor { render: Box::new({ let editor = cx.view().clone(); let hunk = hunk.clone(); + move |cx| { let hunk_controls_menu_handle = editor.read(cx).hunk_controls_menu_handle.clone(); @@ -404,7 +406,7 @@ impl Editor { .w_full() .border_t_1() .border_color(border_color) - .bg(cx.theme().colors().editor_background) + .bg(bg_color) .child( div() .id("gutter-strip") @@ -424,14 +426,9 @@ impl Editor { ) .child( h_flex() - .pl_2() - .pr_6() + .px_6() .size_full() .justify_between() - .border_t_1() - .pl_6() - .pr_6() - .border_color(border_color) .child( h_flex() .gap_1() @@ -608,7 +605,7 @@ impl Editor { move |menu, _| { menu.context(focus.clone()) .action( - "Discard All", + "Discard All Hunks", RevertFile .boxed_clone(), )