pub struct CarouselStyle {Show 35 fields
pub padding: Option<f32>,
pub gap: Option<f32>,
pub rounding: Option<f32>,
pub card: SurfaceStyle,
pub sheet: SurfaceStyle,
pub content_padding: Option<Padding>,
pub layers: Option<usize>,
pub offset: Option<f32>,
pub scale_step: Option<f32>,
pub fade_step: Option<f32>,
pub direction: Option<StackDirection>,
pub exit: Option<Vec2>,
pub exit_rotation: Option<f32>,
pub neighbors: Option<usize>,
pub peek: Option<f32>,
pub slide_scale_step: Option<f32>,
pub slide_drop: Option<f32>,
pub dim: Option<f32>,
pub blur: Option<f32>,
pub scrim: Option<f32>,
pub travel: Option<f32>,
pub commit: Option<f32>,
pub friction: Option<f64>,
pub rubber: Option<f32>,
pub spring: Option<SpringOptions>,
pub wheel_step: Option<f32>,
pub wheel_lock: Option<Duration>,
pub arrow_size: Option<f32>,
pub arrow_inset: Option<f32>,
pub indicator_size: Option<f32>,
pub indicator_gap: Option<f32>,
pub indicator_length: Option<f32>,
pub indicator_color: Option<Color>,
pub indicator_active: Option<Color>,
pub focus_ring: Option<Border>,
}Expand description
Every field is optional; an unset one follows the current Style (the card
surface, accent, focus border and motion spring) or the default noted on the field.
Lengths are logical pixels; “pages” are carousel positions (one page is one step).
Fields§
§padding: Option<f32>Room kept around the pages for shadows and the focus ring. Default 14.
gap: Option<f32>Distance between the pages and an indicator row outside them. Default 14.
rounding: Option<f32>Corner radius of cards and slides. Default 18.
card: SurfaceStylePatch over Style::card.surface for the front card.
sheet: SurfaceStylePatch over the card surface for the sheets behind it.
content_padding: Option<Padding>Inset of the card content (never less than the corner arc needs). Default 16.
layers: Option<usize>Stack: visible layers including the front card. Default 3.
offset: Option<f32>Stack: how far each following sheet peeks out. Default 14.
scale_step: Option<f32>Stack: scale lost per layer. Default 0.05.
fade_step: Option<f32>Stack: opacity lost per layer. Default 0.35.
direction: Option<StackDirection>§exit: Option<Vec2>Stack: where the card leaves to, in card sizes. Default depends on the axis.
exit_rotation: Option<f32>Stack: tilt of a leaving card in radians. Default 0: a tilted card is resampled every frame, which shimmers on small text; set a small angle for the effect.
neighbors: Option<usize>Images: neighbours visible on each side. Default 2.
peek: Option<f32>Images: how far each further neighbour shows past the previous one. Default 36.
slide_scale_step: Option<f32>Images: scale lost per neighbour. Default 0.12.
slide_drop: Option<f32>Images: vertical shift per neighbour. Default 6.
dim: Option<f32>Images: darkening per neighbour, 0..1. Default 0.4.
blur: Option<f32>Images: backdrop blur radius of the nearest neighbour, at most 24. Default off.
scrim: Option<f32>Images: darkening under the overlay of the active slide, 0..1. Default 0.35.
travel: Option<f32>Drag distance of one page, as a part of the page length. Default 0.5.
commit: Option<f32>Part of a page that commits a swipe without momentum. Default 0.25.
friction: Option<f64>Friction of the fling projection; larger flings less far. Default 4.
rubber: Option<f32>Slope of the rubber band at a non-looping edge, 0 disables the give. Default 0.55.
spring: Option<SpringOptions>§wheel_step: Option<f32>Wheel distance that turns one page. Default 10.
wheel_lock: Option<Duration>Wheel input ignored after a turn, so trackpad inertia turns one page. Default 220 ms.
arrow_size: Option<f32>§arrow_inset: Option<f32>§indicator_size: Option<f32>Dot diameter and stroke thickness. Default 6.
indicator_gap: Option<f32>§indicator_length: Option<f32>Length of the active pill or stroke. Default 22.
indicator_color: Option<Color>§indicator_active: Option<Color>§focus_ring: Option<Border>Implementations§
Source§impl CarouselStyle
impl CarouselStyle
pub fn padding(self, value: f32) -> Self
pub fn gap(self, value: f32) -> Self
pub fn rounding(self, value: f32) -> Self
pub fn content_padding(self, value: Padding) -> Self
pub fn layers(self, value: usize) -> Self
pub fn offset(self, value: f32) -> Self
pub fn scale_step(self, value: f32) -> Self
pub fn fade_step(self, value: f32) -> Self
pub fn direction(self, value: StackDirection) -> Self
pub fn exit(self, value: Vec2) -> Self
pub fn exit_rotation(self, value: f32) -> Self
pub fn neighbors(self, value: usize) -> Self
pub fn peek(self, value: f32) -> Self
pub fn slide_scale_step(self, value: f32) -> Self
pub fn slide_drop(self, value: f32) -> Self
pub fn dim(self, value: f32) -> Self
pub fn blur(self, value: f32) -> Self
pub fn scrim(self, value: f32) -> Self
pub fn travel(self, value: f32) -> Self
pub fn commit(self, value: f32) -> Self
pub fn friction(self, value: f64) -> Self
pub fn rubber(self, value: f32) -> Self
pub fn spring(self, value: SpringOptions) -> Self
pub fn wheel_step(self, value: f32) -> Self
pub fn wheel_lock(self, value: Duration) -> Self
pub fn arrow_size(self, value: f32) -> Self
pub fn arrow_inset(self, value: f32) -> Self
pub fn indicator_size(self, value: f32) -> Self
pub fn indicator_gap(self, value: f32) -> Self
pub fn indicator_length(self, value: f32) -> Self
pub fn indicator_color(self, value: Color) -> Self
pub fn indicator_active(self, value: Color) -> Self
pub fn focus_ring(self, value: Border) -> Self
Source§impl CarouselStyle
impl CarouselStyle
pub fn card(self, surface: SurfaceStyle) -> Self
pub fn sheet(self, surface: SurfaceStyle) -> Self
Trait Implementations§
Source§impl Clone for CarouselStyle
impl Clone for CarouselStyle
Source§impl Debug for CarouselStyle
impl Debug for CarouselStyle
Source§impl Default for CarouselStyle
impl Default for CarouselStyle
Source§impl PartialEq for CarouselStyle
impl PartialEq for CarouselStyle
impl StructuralPartialEq for CarouselStyle
Auto Trait Implementations§
impl Freeze for CarouselStyle
impl RefUnwindSafe for CarouselStyle
impl Send for CarouselStyle
impl Sync for CarouselStyle
impl Unpin for CarouselStyle
impl UnsafeUnpin for CarouselStyle
impl UnwindSafe for CarouselStyle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.