pub struct RoundedRectRangeSliderTrackShape;Expand description
The default shape of a RangeSlider’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 RoundRangeSliderThumbShape’s radius. The height is defined by
the SliderThemeData::track_height. The color is determined by the
RangeSlider’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 two thumbs is the active track segment. The
track segments between the thumb and each end of the slider are the inactive
track segments. 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:
RangeSlider, 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.RangeSliderTrackShape, which can be used to create custom shapes for theRangeSlider’s track.RectangularRangeSliderTrackShape, for a similar track with sharp edges.
Implementations§
Source§impl RoundedRectRangeSliderTrackShape
impl RoundedRectRangeSliderTrackShape
Sourcepub const fn new() -> RoundedRectRangeSliderTrackShape
pub const fn new() -> RoundedRectRangeSliderTrackShape
Create a slider track with rounded outer edges.
The middle track segment is the selected range and is active, and the two outer track segments are inactive.
Sourcepub fn paint(
&self,
app: &mut App,
context: &mut PaintingContext,
offset: Offset,
parent_box: AnyRenderBox,
slider_theme: &SliderThemeData,
enable_animation: AnyAnimation<f64>,
start_thumb_center: Offset,
end_thumb_center: Offset,
is_enabled: bool,
is_discrete: bool,
text_direction: TextDirection,
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>, start_thumb_center: Offset, end_thumb_center: Offset, is_enabled: bool, is_discrete: bool, text_direction: TextDirection, additional_active_track_height: f64, )
Dart’s paint override with its extra additionalActiveTrackHeight (Dart’s
default 2), which a call through RangeSliderTrackShape cannot pass.
Trait Implementations§
Source§impl BaseRangeSliderTrackShape for RoundedRectRangeSliderTrackShape
impl BaseRangeSliderTrackShape for RoundedRectRangeSliderTrackShape
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 moreimpl Copy for RoundedRectRangeSliderTrackShape
Source§impl RangeSliderTrackShape for RoundedRectRangeSliderTrackShape
impl RangeSliderTrackShape for RoundedRectRangeSliderTrackShape
Source§fn eq_shape(&self, other: &dyn RangeSliderTrackShape) -> bool
fn eq_shape(&self, other: &dyn RangeSliderTrackShape) -> bool
Value equality, as Dart’s canonicalized const instances are identical.