pub struct SurfaceArgs {
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,
}
Fields§
§style: SurfaceStyle
Defines 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: Shape
Geometric 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: Dp
Internal padding applied symmetrically (left/right & top/bottom). Child content is positioned at (padding, padding). Also influences measured minimum size.
width: DimensionValue
Explicit width constraint (Fixed / Wrap / Fill). Defaults to Wrap
.
height: DimensionValue
Explicit 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
RippleState
is provided
ripple_color: Color
Color of the ripple effect (if interactive & ripple state provided).
block_input: bool
If true, all input events inside the surface bounds are blocked (stop propagation), after (optionally) handling its own click logic.
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,
§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> 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()
.