pub struct SurfaceArgsBuilder { /* private fields */ }
Expand description
Builder for SurfaceArgs
.
Implementations§
Source§impl SurfaceArgsBuilder
impl SurfaceArgsBuilder
Sourcepub fn style(self, value: SurfaceStyle) -> Self
pub fn style(self, value: SurfaceStyle) -> Self
Defines the visual style of the surface (fill, outline, or both).
Sourcepub fn hover_style(self, value: Option<SurfaceStyle>) -> Self
pub fn hover_style(self, value: Option<SurfaceStyle>) -> Self
Optional style to apply when the cursor is hovering over the surface.
This is only active when on_click
is also provided.
Sourcepub fn shape(self, value: Shape) -> Self
pub fn shape(self, value: Shape) -> Self
Geometric outline of the surface (rounded rectangle / ellipse / capsule variants).
Sourcepub fn shadow(self, value: ShadowProps) -> Self
pub fn shadow(self, value: ShadowProps) -> Self
Optional shadow/elevation style. When present it is passed through to the shape pipeline.
Sourcepub fn padding(self, value: Dp) -> Self
pub fn padding(self, value: Dp) -> Self
Internal padding applied symmetrically (left/right & top/bottom). Child content is positioned at (padding, padding). Also influences measured minimum size.
Sourcepub fn width<VALUE: Into<DimensionValue>>(self, value: VALUE) -> Self
pub fn width<VALUE: Into<DimensionValue>>(self, value: VALUE) -> Self
Explicit width constraint (Fixed / Wrap / Fill). Defaults to Wrap
.
Sourcepub fn height<VALUE: Into<DimensionValue>>(self, value: VALUE) -> Self
pub fn height<VALUE: Into<DimensionValue>>(self, value: VALUE) -> Self
Explicit height constraint (Fixed / Wrap / Fill). Defaults to Wrap
.
Sourcepub fn on_click(self, value: Arc<dyn Fn() + Send + Sync>) -> Self
pub fn on_click(self, value: Arc<dyn Fn() + Send + Sync>) -> Self
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
Sourcepub fn ripple_color(self, value: Color) -> Self
pub fn ripple_color(self, value: Color) -> Self
Color of the ripple effect (if interactive & ripple state provided).
Sourcepub fn block_input(self, value: bool) -> Self
pub fn block_input(self, value: bool) -> Self
If true, all input events inside the surface bounds are blocked (stop propagation), after (optionally) handling its own click logic.
Sourcepub fn build(self) -> Result<SurfaceArgs, SurfaceArgsBuilderError>
pub fn build(self) -> Result<SurfaceArgs, SurfaceArgsBuilderError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SurfaceArgsBuilder
impl !RefUnwindSafe for SurfaceArgsBuilder
impl Send for SurfaceArgsBuilder
impl Sync for SurfaceArgsBuilder
impl Unpin for SurfaceArgsBuilder
impl !UnwindSafe for SurfaceArgsBuilder
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
§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()
.