@@ -192,6 +192,14 @@ pub trait TableDelegate {
192192 /// The [`CellInfo::row_nr`] is which header row (usually 0).
193193 fn header_cell_ui ( & mut self , ui : & mut Ui , cell : & HeaderCellInfo ) ;
194194
195+ /// The contents of a row.
196+ ///
197+ /// Individual cell [`Ui`]s will be children of the ui passed to this fn, so you can e.g. use
198+ /// [`Ui::style_mut`] to style the whole row.
199+ ///
200+ /// This might be called multiple times per row (e.g. for sticky and non-sticky columns).
201+ fn row_ui ( & mut self , _ui : & mut Ui , _row_nr : u64 ) { }
202+
195203 /// The contents of a cell in the table.
196204 ///
197205 /// The [`CellInfo::row_nr`] is ignoring header rows.
@@ -678,6 +686,19 @@ impl TableSplitScrollDelegate<'_> {
678686 self . header_row_y . last ( ) + self . get_row_top_offset ( row_nr + 1 ) ,
679687 ) ;
680688
689+ let row_x_range = self . col_x [ 0 ] ..=self . col_x [ self . col_x . len ( ) - 1 ] ;
690+ let row_rect = Rect :: from_x_y_ranges ( row_x_range, y_range) . translate ( -offset) ;
691+
692+ let mut row_ui = ui. new_child (
693+ UiBuilder :: new ( )
694+ . max_rect ( row_rect)
695+ . id_salt ( ( "row" , row_nr) )
696+ . layout ( egui:: Layout :: left_to_right ( egui:: Align :: Center ) ) ,
697+ ) ;
698+ row_ui. set_min_size ( row_rect. size ( ) ) ;
699+
700+ self . table_delegate . row_ui ( & mut row_ui, row_nr) ;
701+
681702 for col_nr in col_range. clone ( ) {
682703 let column = & self . table . columns [ col_nr] ;
683704 let mut cell_rect =
@@ -696,7 +717,7 @@ impl TableSplitScrollDelegate<'_> {
696717 if column. auto_size_this_frame {
697718 ui_builder = ui_builder. sizing_pass ( ) ;
698719 }
699- let mut cell_ui = ui . new_child ( ui_builder) ;
720+ let mut cell_ui = row_ui . new_child ( ui_builder) ;
700721 cell_ui. shrink_clip_rect ( clip_rect) ;
701722
702723 self . table_delegate . cell_ui (
0 commit comments