zng/
slider.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//! Slider widget, styles and properties.
//!
//! This widget allows selecting a value or range by dragging a selector thumb over a range line.
//!
//! ```
//! # use zng::prelude::*;
//! # let _scope = APP.defaults();
//! let value = var(0u8);
//! # let _ =
//! zng::slider::Slider! {
//!     // declare slider with single thumb
//!     selector = zng::slider::Selector::value(value.clone(), 0, 100);
//!     // show selected value
//!     zng::container::child_out_bottom = Text!(value.map_debug()), 5;
//! }
//! # ;
//! ```
//!
//! The example above creates a a slider with a single thumb that selects a `u8` value in the `0..=100` range. The [`Selector`]
//! type also supports creating multiple thumbs and custom range conversions.
//!
//! # Full API
//!
//! See [`zng_wgt_slider`] for the full widget API.

pub use zng_wgt_slider::{DefaultStyle, Selector, SelectorValue, Slider, SliderDirection, SliderTrack, ThumbArgs, SLIDER_DIRECTION_VAR};

/// Slider thumb widget, styles and properties.
///
/// This widget represents one value/offset in a slider.
///
/// # Full API
///
/// See [`zng_wgt_slider::thumb`] for the full widget API.
pub mod thumb {
    pub use zng_wgt_slider::thumb::{DefaultStyle, Thumb};
}