Git · DiffViewer: rows share the hunk button's height, so washes meet

This commit is contained in:
ZacharyZhang-NY committed 2026-10-07 00:28:26 -04:00
1 parent edd2c125e5
commit 30fea9ecec
1 file changed
+9 -1
+9 -1
View File
@@ -276,6 +276,10 @@ impl RenderOnce for DiffViewer {
.len() .len()
.max(2); .max(2);
let (id, on_open) = (self.id.clone(), self.on_open.clone()); let (id, on_open) = (self.id.clone(), self.on_open.clone());
let (button, button_height) = (
self.hunk_action.is_some(),
theme.control_height(ControlSize::Sm),
);
let (selected, on_line, hunk_action) = ( let (selected, on_line, hunk_action) = (
self.selected.clone(), self.selected.clone(),
self.on_line.clone(), self.on_line.clone(),
@@ -342,7 +346,9 @@ impl RenderOnce for DiffViewer {
let element = div() let element = div()
.flex_1() .flex_1()
.min_w_0() .min_w_0()
.h_full()
.flex() .flex()
.items_center()
.gap_2() .gap_2()
.overflow_hidden() .overflow_hidden()
.when_some(wash, |side, wash| side.bg(wash)) .when_some(wash, |side, wash| side.bg(wash))
@@ -366,7 +372,9 @@ impl RenderOnce for DiffViewer {
.border_1() .border_1()
.border_color(transparent_black()) .border_color(transparent_black())
.whitespace_nowrap() .whitespace_nowrap()
.line_height(relative(LEADING)); .line_height(relative(LEADING))
// Rows share one height; the hunk button sets it.
.when(button, |row| row.h(button_height).items_center());
match &rows[ix] { match &rows[ix] {
Shown::Header(stretch, header) => { Shown::Header(stretch, header) => {
let action = hunk_action.clone().map(|(label, run)| { let action = hunk_action.clone().map(|(label, run)| {