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
This commit is contained in:
parent
1e8297a469
commit
dc85378b96
1 changed files with 5 additions and 8 deletions
|
@ -379,6 +379,7 @@ impl Editor {
|
||||||
});
|
});
|
||||||
|
|
||||||
let border_color = cx.theme().colors().border_variant;
|
let border_color = cx.theme().colors().border_variant;
|
||||||
|
let bg_color = cx.theme().colors().editor_background;
|
||||||
let gutter_color = match hunk.status {
|
let gutter_color = match hunk.status {
|
||||||
DiffHunkStatus::Added => cx.theme().status().created,
|
DiffHunkStatus::Added => cx.theme().status().created,
|
||||||
DiffHunkStatus::Modified => cx.theme().status().modified,
|
DiffHunkStatus::Modified => cx.theme().status().modified,
|
||||||
|
@ -394,6 +395,7 @@ impl Editor {
|
||||||
render: Box::new({
|
render: Box::new({
|
||||||
let editor = cx.view().clone();
|
let editor = cx.view().clone();
|
||||||
let hunk = hunk.clone();
|
let hunk = hunk.clone();
|
||||||
|
|
||||||
move |cx| {
|
move |cx| {
|
||||||
let hunk_controls_menu_handle =
|
let hunk_controls_menu_handle =
|
||||||
editor.read(cx).hunk_controls_menu_handle.clone();
|
editor.read(cx).hunk_controls_menu_handle.clone();
|
||||||
|
@ -404,7 +406,7 @@ impl Editor {
|
||||||
.w_full()
|
.w_full()
|
||||||
.border_t_1()
|
.border_t_1()
|
||||||
.border_color(border_color)
|
.border_color(border_color)
|
||||||
.bg(cx.theme().colors().editor_background)
|
.bg(bg_color)
|
||||||
.child(
|
.child(
|
||||||
div()
|
div()
|
||||||
.id("gutter-strip")
|
.id("gutter-strip")
|
||||||
|
@ -424,14 +426,9 @@ impl Editor {
|
||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
h_flex()
|
h_flex()
|
||||||
.pl_2()
|
.px_6()
|
||||||
.pr_6()
|
|
||||||
.size_full()
|
.size_full()
|
||||||
.justify_between()
|
.justify_between()
|
||||||
.border_t_1()
|
|
||||||
.pl_6()
|
|
||||||
.pr_6()
|
|
||||||
.border_color(border_color)
|
|
||||||
.child(
|
.child(
|
||||||
h_flex()
|
h_flex()
|
||||||
.gap_1()
|
.gap_1()
|
||||||
|
@ -608,7 +605,7 @@ impl Editor {
|
||||||
move |menu, _| {
|
move |menu, _| {
|
||||||
menu.context(focus.clone())
|
menu.context(focus.clone())
|
||||||
.action(
|
.action(
|
||||||
"Discard All",
|
"Discard All Hunks",
|
||||||
RevertFile
|
RevertFile
|
||||||
.boxed_clone(),
|
.boxed_clone(),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue