pub struct CheckboxArgs {
pub on_toggle: Arc<dyn Fn(bool) + Send + Sync>,
pub size: Dp,
pub color: Color,
pub checked_color: Color,
pub checkmark_color: Color,
pub checkmark_stroke_width: f32,
pub checkmark_animation_progress: f32,
pub shape: Shape,
pub hover_color: Option<Color>,
pub accessibility_label: Option<String>,
pub accessibility_description: Option<String>,
}Expand description
Arguments for the checkbox component.
Fields§
§on_toggle: Arc<dyn Fn(bool) + Send + Sync>Callback invoked when the checkbox is toggled.
size: DpSize of the checkbox (width and height).
Expressed in Dp (density-independent pixels). The checkbox will use
the same value for width and height; default is Dp(24.0).
color: ColorBackground color when the checkbox is not checked.
This sets the surface color shown for the unchecked state and is typically a subtle neutral color.
checked_color: ColorBackground color used when the checkbox is checked.
This color is shown behind the checkmark to indicate an active/selected
state. Choose a higher-contrast color relative to color.
checkmark_color: ColorColor used to draw the checkmark icon inside the checkbox.
This is applied on top of the checked_color surface.
checkmark_stroke_width: f32Stroke width in physical pixels used to render the checkmark path.
Higher values produce a thicker checkmark. The default value is tuned for
the default size.
checkmark_animation_progress: f32Initial animation progress of the checkmark (0.0 ..= 1.0).
Used to drive the checkmark animation when toggling. 0.0 means not
visible; 1.0 means fully drawn. Values in-between show the intermediate
animation state.
shape: ShapeShape used for the outer checkbox surface (rounded rectangle, etc.).
Use this to customize the corner radii or switch to alternate shapes.
hover_color: Option<Color>Optional surface color to apply when the pointer hovers over the control.
If None, the control does not apply a hover style by default.
accessibility_label: Option<String>Optional accessibility label read by assistive technologies.
The label should be a short, human-readable string describing the purpose of the checkbox (for example “Enable auto-save”).
accessibility_description: Option<String>Optional accessibility description read by assistive technologies.
A longer description or contextual helper text that augments the
accessibility_label for users of assistive technology.
Trait Implementations§
Source§impl Clone for CheckboxArgs
impl Clone for CheckboxArgs
Source§fn clone(&self) -> CheckboxArgs
fn clone(&self) -> CheckboxArgs
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for CheckboxArgs
impl !RefUnwindSafe for CheckboxArgs
impl Send for CheckboxArgs
impl Sync for CheckboxArgs
impl Unpin for CheckboxArgs
impl !UnwindSafe for CheckboxArgs
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().