Skip to main content

CarouselStyle

Struct CarouselStyle 

Source
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: SurfaceStyle

Patch over Style::card.surface for the front card.

§sheet: SurfaceStyle

Patch 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

Source

pub fn padding(self, value: f32) -> Self

Source

pub fn gap(self, value: f32) -> Self

Source

pub fn rounding(self, value: f32) -> Self

Source

pub fn content_padding(self, value: Padding) -> Self

Source

pub fn layers(self, value: usize) -> Self

Source

pub fn offset(self, value: f32) -> Self

Source

pub fn scale_step(self, value: f32) -> Self

Source

pub fn fade_step(self, value: f32) -> Self

Source

pub fn direction(self, value: StackDirection) -> Self

Source

pub fn exit(self, value: Vec2) -> Self

Source

pub fn exit_rotation(self, value: f32) -> Self

Source

pub fn neighbors(self, value: usize) -> Self

Source

pub fn peek(self, value: f32) -> Self

Source

pub fn slide_scale_step(self, value: f32) -> Self

Source

pub fn slide_drop(self, value: f32) -> Self

Source

pub fn dim(self, value: f32) -> Self

Source

pub fn blur(self, value: f32) -> Self

Source

pub fn scrim(self, value: f32) -> Self

Source

pub fn travel(self, value: f32) -> Self

Source

pub fn commit(self, value: f32) -> Self

Source

pub fn friction(self, value: f64) -> Self

Source

pub fn rubber(self, value: f32) -> Self

Source

pub fn spring(self, value: SpringOptions) -> Self

Source

pub fn wheel_step(self, value: f32) -> Self

Source

pub fn wheel_lock(self, value: Duration) -> Self

Source

pub fn arrow_size(self, value: f32) -> Self

Source

pub fn arrow_inset(self, value: f32) -> Self

Source

pub fn indicator_size(self, value: f32) -> Self

Source

pub fn indicator_gap(self, value: f32) -> Self

Source

pub fn indicator_length(self, value: f32) -> Self

Source

pub fn indicator_color(self, value: Color) -> Self

Source

pub fn indicator_active(self, value: Color) -> Self

Source

pub fn focus_ring(self, value: Border) -> Self

Source§

impl CarouselStyle

Source

pub fn card(self, surface: SurfaceStyle) -> Self

Source

pub fn sheet(self, surface: SurfaceStyle) -> Self

Trait Implementations§

Source§

impl Clone for CarouselStyle

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CarouselStyle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CarouselStyle

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for CarouselStyle

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CarouselStyle

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> NoneValue for T
where T: Default,

Source§

type NoneType = T

Source§

fn null_value() -> T

The none-equivalent value.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more