table: Render custom row background first on striped table (#1177)

This commit is contained in:
Floyd Wang 2025-08-28 10:44:10 +08:00 committed by GitHub
parent 2a652dcc01
commit f72e858d3a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1054,15 +1054,18 @@ where
true
};
self.delegate
.render_tr(row_ix, window, cx)
.h_flex()
let mut tr = self.delegate.render_tr(row_ix, window, cx);
let tr_has_bg = tr.style().background.is_some();
tr.h_flex()
.w_full()
.h(self.size.table_row_height())
.when(need_render_border, |this| {
this.border_b_1().border_color(cx.theme().table_row_border)
})
.when(is_stripe_row, |this| this.bg(cx.theme().table_even))
.when(is_stripe_row && !tr_has_bg, |this| {
this.bg(cx.theme().table_even)
})
.hover(|this| {
if is_selected || self.right_clicked_row == Some(row_ix) {
this