feat: change background color

This commit is contained in:
2026-05-28 21:08:51 +01:00
parent f8a1c3f42b
commit 75c3b73665
4 changed files with 86 additions and 87 deletions

View File

@@ -122,8 +122,8 @@ impl PullRequestDiffView {
) {
if let Some(diff) = {
match read_query(query, cx) {
| QueryStatus::Loaded(diff) => Some(Arc::clone(diff)),
| _ => None,
| QueryStatus::Loaded(diff) => Some(Arc::clone(diff)),
| _ => None,
}
} {
self.load_diff_view(diff, cx);
@@ -158,16 +158,16 @@ impl PullRequestDiffView {
_ = cx
.spawn(async move |weak, cx| match tokio::join!(t1, t2) {
| (Some(old_side_highlights), Some(new_side_highlights)) => {
_ = weak.update(cx, |this, cx| {
this.diff_view_state
.set_old_side_highlights(old_side_highlights);
this.diff_view_state
.set_new_side_highlights(new_side_highlights);
cx.notify();
});
}
| _ => {}
| (Some(old_side_highlights), Some(new_side_highlights)) => {
_ = weak.update(cx, |this, cx| {
this.diff_view_state
.set_old_side_highlights(old_side_highlights);
this.diff_view_state
.set_new_side_highlights(new_side_highlights);
cx.notify();
});
}
| _ => {}
})
.detach();
}
@@ -189,30 +189,31 @@ impl gpui::Render for PullRequestDiffView {
.unwrap_or(QueryStatus::Loading);
match content_diff {
| QueryStatus::Err(_) | QueryStatus::Loading => div()
.size_full()
.bg(theme.colors.surface)
.p_4()
.child(text("asd")),
| QueryStatus::Err(_) | QueryStatus::Loading => div()
.size_full()
.bg(theme.colors.surface)
.p_4()
.child(text("asd")),
| QueryStatus::Loaded(_) => match &self.diff_view_content {
| Some(content) => div()
.size_full()
.flex()
.flex_row()
.child(
div()
| QueryStatus::Loaded(_) => match &self.diff_view_content {
| Some(content) => div()
.size_full()
.flex()
.w_80()
.h_full()
.border_r_1()
.border_color(theme.colors.border_muted)
.p_1()
.child(self.file_tree.clone()),
)
.child(diff_view(self.diff_view_state.clone(), content.clone())),
| None => div(),
},
.flex_row()
.child(
div()
.flex()
.w_80()
.h_full()
.bg(theme.colors.surface_chrome)
.border_r_1()
.border_color(theme.colors.border_muted)
.p_1()
.child(self.file_tree.clone()),
)
.child(diff_view(self.diff_view_state.clone(), content.clone())),
| None => div(),
},
}
}
}