From 3cff72cc3703b93e1ec55e13728930d6f36b64f8 Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Wed, 23 Apr 2025 22:09:14 +0800 Subject: [PATCH] table: Fix `render_tr` to ensure apply with h_flex. (#810) - Reduce last empty column to 12px. --- crates/ui/src/table.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/ui/src/table.rs b/crates/ui/src/table.rs index 92107392..ca376790 100644 --- a/crates/ui/src/table.rs +++ b/crates/ui/src/table.rs @@ -6,7 +6,7 @@ use crate::{ h_flex, popup_menu::PopupMenu, scroll::{self, ScrollableMask, Scrollbar, ScrollbarState}, - v_flex, ActiveTheme, Icon, IconName, Sizable, Size, StyleSized as _, + v_flex, ActiveTheme, Icon, IconName, Sizable, Size, StyleSized as _, StyledExt, }; use gpui::{ actions, canvas, div, prelude::FluentBuilder, px, uniform_list, App, AppContext, Axis, Bounds, @@ -344,7 +344,7 @@ pub trait TableDelegate: Sized + 'static { /// Render the last empty column, default to empty. fn render_last_empty_col(&mut self, window: &mut Window, cx: &mut Context>) -> Div { - h_flex().w_5().h_full().flex_shrink_0() + h_flex().w_3().h_full().flex_shrink_0() } /// Called when the visible range of the rows changed. @@ -1237,6 +1237,7 @@ where if row_ix < rows_count { self.delegate .render_tr(row_ix, window, cx) + .h_flex() .w_full() .h(self.size.table_row_height()) .border_b_1() @@ -1380,6 +1381,7 @@ where // Render fake rows to fill the rest table space self.delegate .render_tr(row_ix, window, cx) + .h_flex() .w_full() .h_full() .border_t_1()