From fe585e48e9bd91f48e139acb39a1cc0c6f38127f Mon Sep 17 00:00:00 2001 From: Hizoul Date: Wed, 28 Oct 2020 16:56:33 +0100 Subject: [PATCH] Make `from_get_set` public (#34) This allows the slider value to be obtained from anywhere that can be accessed from a closure and not just a `&'a mut` reference. An example would be a state that is shared via an Arc> or Atomic value with a background thread --- egui/src/widgets/slider.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/egui/src/widgets/slider.rs b/egui/src/widgets/slider.rs index d6a9b36d..38f5dccd 100644 --- a/egui/src/widgets/slider.rs +++ b/egui/src/widgets/slider.rs @@ -49,7 +49,7 @@ pub struct Slider<'a> { } impl<'a> Slider<'a> { - fn from_get_set( + pub fn from_get_set( range: RangeInclusive, get_set_value: impl 'a + FnMut(Option) -> f64, ) -> Self {