pub struct RoundedRectSliderTrackShape;Expand description
The default shape of a Slider’s track.
It paints a solid colored rectangle with rounded edges, vertically centered
in the parent_box. The track rectangle extends to the bounds of the
parent_box, but is padded by the larger of RoundSliderOverlayShape’s
radius and RoundSliderThumbShape’s radius. The height is defined by the
SliderThemeData::track_height. The color is determined by the Slider’s
enabled state and the track segment’s active state which are defined by:
SliderThemeData::active_track_color,
SliderThemeData::inactive_track_color,
SliderThemeData::disabled_active_track_color,
SliderThemeData::disabled_inactive_track_color.
The track segment between the start of the slider and the thumb is the
active track segment. The track segment between the thumb and the end of the
slider is the inactive track segment. In TextDirection::Ltr, the start of
the slider is on the left, and in TextDirection::Rtl, the start of the
slider is on the right.
See also:
Slider, for the component that is meant to display this shape.SliderThemeData, where an instance of this class is set to inform the slider of the visual details of the its track.SliderTrackShape, which can be used to create custom shapes for theSlider’s track.RectangularSliderTrackShape, for a similar track with sharp edges.
Implementations§
Source§impl RoundedRectSliderTrackShape
impl RoundedRectSliderTrackShape
Sourcepub const fn new() -> RoundedRectSliderTrackShape
pub const fn new() -> RoundedRectSliderTrackShape
Create a slider track that draws two rectangles with rounded outer edges.
Sourcepub fn paint(
&self,
app: &mut App,
context: &mut PaintingContext,
offset: Offset,
parent_box: AnyRenderBox,
slider_theme: &SliderThemeData,
enable_animation: AnyAnimation<f64>,
text_direction: TextDirection,
thumb_center: Offset,
secondary_offset: Option<Offset>,
is_discrete: bool,
is_enabled: bool,
additional_active_track_height: f64,
)
pub fn paint( &self, app: &mut App, context: &mut PaintingContext, offset: Offset, parent_box: AnyRenderBox, slider_theme: &SliderThemeData, enable_animation: AnyAnimation<f64>, text_direction: TextDirection, thumb_center: Offset, secondary_offset: Option<Offset>, is_discrete: bool, is_enabled: bool, additional_active_track_height: f64, )
Dart’s paint with its extra additionalActiveTrackHeight argument, which the
SliderTrackShape::paint override passes as Dart’s default, 2.
Trait Implementations§
Source§impl BaseSliderTrackShape for RoundedRectSliderTrackShape
impl BaseSliderTrackShape for RoundedRectSliderTrackShape
Source§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 get_preferred_rect( &self, app: &App, parent_box: AnyRenderBox, offset: Offset, slider_theme: &SliderThemeData, is_enabled: Option<bool>, is_discrete: Option<bool>, ) -> Rect
Slider. Read moreSource§fn is_rounded(&self) -> bool
fn is_rounded(&self) -> bool
Source§impl Clone for RoundedRectSliderTrackShape
impl Clone for RoundedRectSliderTrackShape
impl Copy for RoundedRectSliderTrackShape
Source§impl Debug for RoundedRectSliderTrackShape
impl Debug for RoundedRectSliderTrackShape
Source§impl SliderTrackShape for RoundedRectSliderTrackShape
impl SliderTrackShape for RoundedRectSliderTrackShape
Source§fn eq_shape(&self, other: &dyn SliderTrackShape) -> bool
fn eq_shape(&self, other: &dyn SliderTrackShape) -> bool
Value equality, as Dart’s canonicalized const instances are identical.