pub trait BaseSliderTrackShape {
// Provided methods
fn get_preferred_rect(
&self,
app: &App,
parent_box: AnyRenderBox,
offset: Offset,
slider_theme: &SliderThemeData,
is_enabled: Option<bool>,
is_discrete: Option<bool>,
) -> Rect { ... }
fn is_rounded(&self) -> bool { ... }
}Expand description
Base track shape that provides an implementation of
get_preferred_rect for default sizing.
The height is set from SliderThemeData::track_height and the width of the
parent box less the larger of the widths of SliderThemeData::thumb_shape and
SliderThemeData::overlay_shape.
A track that mixes it in calls these bodies from its SliderTrackShape methods.
See also:
RectangularSliderTrackShape, which is a track shape with sharp rectangular edgesRoundedRectSliderTrackShape, which is a track shape with round stadium-like edges.
Provided Methods§
Sourcefn get_preferred_rect(
&self,
app: &App,
parent_box: AnyRenderBox,
offset: Offset,
slider_theme: &SliderThemeData,
is_enabled: Option<bool>,
is_discrete: Option<bool>,
) -> Rect
fn get_preferred_rect( &self, app: &App, parent_box: AnyRenderBox, offset: Offset, slider_theme: &SliderThemeData, is_enabled: Option<bool>, is_discrete: Option<bool>, ) -> Rect
Returns a rect that represents the track bounds that fits within the
Slider.
The width is the width of the Slider or RangeSlider, but padded by
the max of the overlay and thumb radius. The height is defined by the
SliderThemeData::track_height.
The Rect is centered both horizontally and vertically within the slider
bounds.
Sourcefn is_rounded(&self) -> bool
fn is_rounded(&self) -> bool
Whether the track shape is rounded. This is used to determine the correct position of the thumb in relation to the track. Defaults to false.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".