pub struct CheckboxArgsBuilder { /* private fields */ }Expand description
Builder for CheckboxArgs.
Implementations§
Source§impl CheckboxArgsBuilder
impl CheckboxArgsBuilder
Sourcepub fn on_toggle(self, value: Arc<dyn Fn(bool) + Send + Sync>) -> Self
pub fn on_toggle(self, value: Arc<dyn Fn(bool) + Send + Sync>) -> Self
Callback invoked when the checkbox is toggled.
Sourcepub fn size(self, value: Dp) -> Self
pub fn size(self, value: Dp) -> Self
Size 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).
Sourcepub fn color(self, value: Color) -> Self
pub fn color(self, value: Color) -> Self
Background color when the checkbox is not checked.
This sets the surface color shown for the unchecked state and is typically a subtle neutral color.
Sourcepub fn checked_color(self, value: Color) -> Self
pub fn checked_color(self, value: Color) -> Self
Background 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.
Sourcepub fn checkmark_color(self, value: Color) -> Self
pub fn checkmark_color(self, value: Color) -> Self
Color used to draw the checkmark icon inside the checkbox.
This is applied on top of the checked_color surface.
Sourcepub fn checkmark_stroke_width(self, value: f32) -> Self
pub fn checkmark_stroke_width(self, value: f32) -> Self
Stroke 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.
Sourcepub fn checkmark_animation_progress(self, value: f32) -> Self
pub fn checkmark_animation_progress(self, value: f32) -> Self
Initial 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.
pub fn shape(self, value: Shape) -> Self
Sourcepub fn hover_color(self, value: Option<Color>) -> Self
pub fn hover_color(self, value: Option<Color>) -> Self
Shape used for the outer checkbox surface (rounded rectangle, etc.).
Use this to customize the corner radii or switch to alternate shapes.
Sourcepub fn accessibility_label<VALUE: Into<String>>(self, value: VALUE) -> Self
pub fn accessibility_label<VALUE: Into<String>>(self, value: VALUE) -> Self
Optional surface color to apply when the pointer hovers over the control.
If None, the control does not apply a hover style by default.
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”).
Sourcepub fn accessibility_description<VALUE: Into<String>>(
self,
value: VALUE,
) -> Self
pub fn accessibility_description<VALUE: Into<String>>( self, value: VALUE, ) -> Self
Optional accessibility description read by assistive technologies.
A longer description or contextual helper text that augments the
accessibility_label for users of assistive technology.
Sourcepub fn build(self) -> Result<CheckboxArgs, CheckboxArgsBuilderError>
pub fn build(self) -> Result<CheckboxArgs, CheckboxArgsBuilderError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CheckboxArgsBuilder
impl !RefUnwindSafe for CheckboxArgsBuilder
impl Send for CheckboxArgsBuilder
impl Sync for CheckboxArgsBuilder
impl Unpin for CheckboxArgsBuilder
impl !UnwindSafe for CheckboxArgsBuilder
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> 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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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