pub struct SwitchButtonSpec {Show 16 fields
pub colors: WearColors,
pub label_style: WearTextStyle,
pub secondary_style: WearTextStyle,
pub min_height: f32,
pub corner_radius: f32,
pub padding_horizontal: f32,
pub padding_vertical: f32,
pub switch_width: f32,
pub switch_slot_height: f32,
pub switch_height: f32,
pub track_border_width: f32,
pub thumb_radius_unchecked: f32,
pub thumb_radius_checked: f32,
pub control_spacing: f32,
pub label_spacing: f32,
pub progress: f32,
}Expand description
SwitchButtonDefaults plus ToggleButton’s layout constants.
Fields§
§colors: WearColors§label_style: WearTextStyle§secondary_style: WearTextStyle§min_height: f32§corner_radius: f32§padding_horizontal: f32§padding_vertical: f32§switch_width: f32SWITCH_WIDTH.
switch_slot_height: f32SWITCH_OUTER_HEIGHT — the slot the graphic is placed in.
switch_height: f32SWITCH_INNER_HEIGHT — what the graphic actually draws.
track_border_width: f32SWITCH_TRACK_WIDTH — the unchecked state’s border stroke.
thumb_radius_unchecked: f32§thumb_radius_checked: f32§control_spacing: f32TOGGLE_CONTROL_SPACING.
label_spacing: f32LabelSpacerSize.
progress: f32How far the thumb has travelled, 0.0 unchecked and 1.0 checked.
A caller animating the transition drives this; a caller that does not
passes the checked state itself. Wear animates it with
motionScheme.fastEffectsSpec(), a critically damped spring of
stiffness 1400.
Implementations§
Trait Implementations§
Source§impl Clone for SwitchButtonSpec
impl Clone for SwitchButtonSpec
Source§fn clone(&self) -> SwitchButtonSpec
fn clone(&self) -> SwitchButtonSpec
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SwitchButtonSpec
Source§impl Debug for SwitchButtonSpec
impl Debug for SwitchButtonSpec
Source§impl Default for SwitchButtonSpec
impl Default for SwitchButtonSpec
Source§impl PartialEq for SwitchButtonSpec
impl PartialEq for SwitchButtonSpec
impl StructuralPartialEq for SwitchButtonSpec
Auto Trait Implementations§
impl Freeze for SwitchButtonSpec
impl RefUnwindSafe for SwitchButtonSpec
impl Send for SwitchButtonSpec
impl Sync for SwitchButtonSpec
impl Unpin for SwitchButtonSpec
impl UnsafeUnpin for SwitchButtonSpec
impl UnwindSafe for SwitchButtonSpec
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
Mutably borrows from an owned value. Read more