Skip to content
Discussion options

You must be logged in to vote

You can use the same trick that the table itself uses internally to paint the stripes and the selected row:

let max_rect = self.cell_rect(&width, &height);
// Make sure we don't have a gap in the stripe/frame/selection background:
let item_spacing = self.ui.spacing().item_spacing;
let gapless_rect = max_rect.expand2(0.5 * item_spacing);
if flags.striped {
self.ui.painter().rect_filled(
gapless_rect,
egui::Rounding::ZERO,
self.ui.visuals().faint_bg_color,
);
}
if flags.selected {
self.ui.painter().rect_filled(
gapless_rect,
egui::R…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@hendrix63
Comment options

@Avrahqedivra
Comment options

Answer selected by hendrix63
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants