diff --git a/docs/images/modals_slider.png b/docs/images/modals_slider.png new file mode 100644 index 000000000..8606e6118 Binary files /dev/null and b/docs/images/modals_slider.png differ diff --git a/services/modals/src/lib.rs b/services/modals/src/lib.rs index 9e7065fed..6a799a0ed 100644 --- a/services/modals/src/lib.rs +++ b/services/modals/src/lib.rs @@ -386,6 +386,33 @@ impl Modals { Ok(()) } + + /// Human interaction-enabled slider. + /// + /// - Interactable until home/enter is pressed. + /// - Use the arrow keys to shift the slider by a step in either direction. + /// - Note that it is possible to exceed start or end if you choose the 'step' value poorly. + /// - Title text wraps, burden is on the consumer not to exceed the available screen space. + /// + ///
+ /// Example Image + /// + /// ![Example Image - Initial](https://github.com/rowr111/xous-core/blob/main/docs/images/modals_slider.png?raw=true) + /// + ///
+ /// + /// # Example + /// ``` + /// use modals::Modals; + /// use xous_names::XousNames; + /// let xns = XousNames::new().unwrap(); + /// let modals = Modals::new(&xns).unwrap(); + /// + /// let result = modals + /// .slider("Human interaction-enabled slider!", 0, 100, 50, 1) + /// .expect("slider test failed"); + /// log::info!("result: {}", &result); + /// ``` pub fn slider( &self, title: &str,