pub trait SliderStyle: 'static {
// Required method
fn make_body(
&self,
cfg: &SliderStyleConfig,
ctx: &mut BuildContext<'_>,
) -> WidgetId;
// Provided method
fn thumb_diameter(&self, _cfg: &SliderStyleConfig) -> f32 { ... }
}Required Methods§
fn make_body( &self, cfg: &SliderStyleConfig, ctx: &mut BuildContext<'_>, ) -> WidgetId
Provided Methods§
Sourcefn thumb_diameter(&self, _cfg: &SliderStyleConfig) -> f32
fn thumb_diameter(&self, _cfg: &SliderStyleConfig) -> f32
Diameter, in logical pixels, of the draggable thumb produced by
make_body. The host Slider widget uses this to compute the drag
hit-region and the position→value mapping at event time (when it can
no longer reach the theme). The default matches the IntUI recipe’s
thumb; a custom style that paints a different thumb size MUST override
this too, or dragging will map to the wrong pixel boundary.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".