mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 06:40:06 -04:00
Fix: assign a different id to each table cell, avoiding id clashes (#4076)
Each cell in a table now has a `Ui` with a unique `Id` based on the row and column. This avoids Id-clashes, e.g. when putting a `CollapsingHeader` in a table cell.
This commit is contained in:
@@ -1166,7 +1166,13 @@ impl<'a, 'b> TableRow<'a, 'b> {
|
||||
selected: self.selected,
|
||||
};
|
||||
|
||||
let (used_rect, response) = self.layout.add(flags, width, height, add_cell_contents);
|
||||
let (used_rect, response) = self.layout.add(
|
||||
flags,
|
||||
width,
|
||||
height,
|
||||
egui::Id::new((self.row_index, col_index)),
|
||||
add_cell_contents,
|
||||
);
|
||||
|
||||
if let Some(max_w) = self.max_used_widths.get_mut(col_index) {
|
||||
*max_w = max_w.max(used_rect.width());
|
||||
|
||||
Reference in New Issue
Block a user