parent
1e885abe08
commit
ea6bdfc1c9
|
|
@ -47,7 +47,7 @@ impl State {
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// type alias for boxed function to determine row color during grid generation
|
// type alias for boxed function to determine row color during grid generation
|
||||||
type ColorPickerFn = Box<dyn Fn(usize, &Style) -> Option<Color32>>;
|
type ColorPickerFn = Box<dyn Send + Sync + Fn(usize, &Style) -> Option<Color32>>;
|
||||||
|
|
||||||
pub(crate) struct GridLayout {
|
pub(crate) struct GridLayout {
|
||||||
ctx: Context,
|
ctx: Context,
|
||||||
|
|
@ -312,7 +312,7 @@ impl Grid {
|
||||||
/// Setting this will allow for dynamic coloring of rows of the grid object
|
/// Setting this will allow for dynamic coloring of rows of the grid object
|
||||||
pub fn with_row_color<F>(mut self, color_picker: F) -> Self
|
pub fn with_row_color<F>(mut self, color_picker: F) -> Self
|
||||||
where
|
where
|
||||||
F: Fn(usize, &Style) -> Option<Color32> + 'static,
|
F: Send + Sync + Fn(usize, &Style) -> Option<Color32> + 'static,
|
||||||
{
|
{
|
||||||
self.color_picker = Some(Box::new(color_picker));
|
self.color_picker = Some(Box::new(color_picker));
|
||||||
self
|
self
|
||||||
|
|
|
||||||
|
|
@ -2245,3 +2245,9 @@ impl Ui {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn ui_impl_send_sync() {
|
||||||
|
fn assert_send_sync<T: Send + Sync>() {}
|
||||||
|
assert_send_sync::<Ui>();
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue