pub struct BoxShadow {
pub offset_x: f64,
pub offset_y: f64,
pub blur: f64,
pub spread: f64,
pub color: Color,
pub is_inset: bool,
}Expand description
Represents a box shadow which can be attached to an element or control.
Fields§
§offset_x: f64The horizontal offset (distance) of the shadow.
offset_y: f64The vertical offset (distance) of the shadow.
blur: f64The blur radius. A higher value results in a more blurred shadow.
spread: f64The spread radius. Positive values make the shadow grow, negative values make it shrink.
color: ColorThe color of the shadow.
is_inset: boolWhether the shadow is an inner shadow (inset) rather than an outer shadow (outset).
Implementations§
Source§impl BoxShadow
impl BoxShadow
Sourcepub fn parse(s: &str) -> Result<BoxShadow, FormatError>
pub fn parse(s: &str) -> Result<BoxShadow, FormatError>
Parses a BoxShadow string: [inset] offset-x offset-y [blur [spread]] color,
or none.
Sourcepub fn transform_bounds(&self, rect: Rect) -> Rect
pub fn transform_bounds(&self, rect: Rect) -> Rect
Transforms the specified bounding rectangle to account for the shadow’s offset, spread, and blur.
Trait Implementations§
Source§impl BatchValue for BoxShadow
impl BatchValue for BoxShadow
impl Copy for BoxShadow
Source§impl MarkupTyped for BoxShadow
impl MarkupTyped for BoxShadow
Source§const MARKUP: &'static MarkupType
const MARKUP: &'static MarkupType
The markup metadata of the type.
impl StructuralPartialEq for BoxShadow
Auto Trait Implementations§
impl Freeze for BoxShadow
impl RefUnwindSafe for BoxShadow
impl Send for BoxShadow
impl Sync for BoxShadow
impl Unpin for BoxShadow
impl UnsafeUnpin for BoxShadow
impl UnwindSafe for BoxShadow
Blanket Implementations§
Source§impl<T> AnyValue for Twhere
T: PartialEq + 'static,
impl<T> AnyValue for Twhere
T: PartialEq + 'static,
fn any_value_as_any(&self) -> &(dyn Any + 'static)
fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool
fn any_value_type_name(&self) -> &'static str
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
Mutably borrows from an owned value. Read more
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more