pub struct SurfaceArgs {Show 14 fields
pub style: SurfaceStyle,
pub hover_style: Option<SurfaceStyle>,
pub shape: Shape,
pub shadow: Option<ShadowProps>,
pub padding: Dp,
pub width: DimensionValue,
pub height: DimensionValue,
pub on_click: Option<Arc<dyn Fn() + Send + Sync>>,
pub ripple_color: Color,
pub block_input: bool,
pub accessibility_role: Option<Role>,
pub accessibility_label: Option<String>,
pub accessibility_description: Option<String>,
pub accessibility_focusable: bool,
}Fields§
§style: SurfaceStyleDefines the visual style of the surface (fill, outline, or both).
hover_style: Option<SurfaceStyle>Optional style to apply when the cursor is hovering over the surface.
This is only active when on_click is also provided.
shape: ShapeGeometric outline of the surface (rounded rectangle / ellipse / capsule variants).
shadow: Option<ShadowProps>Optional shadow/elevation style. When present it is passed through to the shape pipeline.
padding: DpInternal padding applied symmetrically (left/right & top/bottom). Child content is positioned at (padding, padding). Also influences measured minimum size.
width: DimensionValueExplicit width constraint (Fixed / Wrap / Fill). Defaults to Wrap.
height: DimensionValueExplicit height constraint (Fixed / Wrap / Fill). Defaults to Wrap.
on_click: Option<Arc<dyn Fn() + Send + Sync>>Optional click handler. Presence of this value makes the surface interactive:
- Cursor changes to pointer when hovered
- Press / release events are captured
- Ripple animation starts on press if a
RippleStateis provided
ripple_color: ColorColor of the ripple effect (if interactive & ripple state provided).
block_input: boolIf true, all input events inside the surface bounds are blocked (stop propagation), after (optionally) handling its own click logic.
accessibility_role: Option<Role>Optional explicit accessibility role. Defaults to Role::Button when interactive.
accessibility_label: Option<String>Optional label read by assistive technologies.
accessibility_description: Option<String>Optional description read by assistive technologies.
accessibility_focusable: boolWhether this surface should be focusable even when not interactive.
Trait Implementations§
Source§impl Clone for SurfaceArgs
impl Clone for SurfaceArgs
Source§fn clone(&self) -> SurfaceArgs
fn clone(&self) -> SurfaceArgs
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 SurfaceArgs
impl !RefUnwindSafe for SurfaceArgs
impl Send for SurfaceArgs
impl Sync for SurfaceArgs
impl Unpin for SurfaceArgs
impl !UnwindSafe for SurfaceArgs
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,
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