From 9ddf7abeeeb199e8e9f3189b75e2e0e2c037cebd Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Thu, 30 Mar 2023 03:01:22 -0500 Subject: [PATCH] feat: simple grid row color picker (#2519) * feat: simple grid row color picker * feat: allow painting initial grid row * avoid coloring callback for striped when not needed Co-authored-by: Emil Ernerfeldt * fix: switch from rgba to color32 for row grid color assignment * fix warning * make `paint_row` private --------- Co-authored-by: Emil Ernerfeldt --- crates/egui/src/grid.rs | 75 +++++++++++++++++++++++++++++------------ 1 file changed, 53 insertions(+), 22 deletions(-) diff --git a/crates/egui/src/grid.rs b/crates/egui/src/grid.rs index e84b6b42..c3427a96 100644 --- a/crates/egui/src/grid.rs +++ b/crates/egui/src/grid.rs @@ -46,6 +46,9 @@ impl State { // ---------------------------------------------------------------------------- +// type alias for boxed function to determine row color during grid generation +type ColorPickerFn = Box Option>; + pub(crate) struct GridLayout { ctx: Context, style: std::sync::Arc