Skip to main content

Visual

Struct Visual 

Source
pub struct Visual {
Show 41 fields pub background_color: Option<String>, pub background_gradient: Option<Gradient>, pub color: Option<String>, pub border_width: Option<f32>, pub border_widths: Option<[f32; 4]>, pub border_color: Option<String>, pub border_style: Option<String>, pub border_radius: Option<f32>, pub corner_radii: Option<[f32; 4]>, pub opacity: Option<f32>, pub box_shadow: Option<Vec<ShadowLayer>>, pub font_size: Option<f32>, pub font_weight: Option<u16>, pub line_height: Option<f32>, pub font_family: Option<String>, pub text_align: Option<String>, pub letter_spacing: Option<f32>, pub text_decoration: Option<String>, pub text_transform: Option<String>, pub font_style: Option<String>, pub padding_horizontal: Option<f32>, pub padding_vertical: Option<f32>, pub padding: Option<[f32; 4]>, pub gap: Option<f32>, pub native: bool, pub overflow_hidden: bool, pub overflow_scroll: bool, pub overflow_x: Option<String>, pub overflow_y: Option<String>, pub transform: Option<Vec<TransformOp>>, pub transition: Option<Transition>, pub visibility_hidden: bool, pub display_none: bool, pub pointer_events_none: bool, pub user_select: Option<String>, pub cursor: Option<String>, pub series_colors: Option<Vec<String>>, pub direction: Option<String>, pub backdrop_blur: Option<f32>, pub animation: Option<VisualAnimation>, pub sticky: bool,
}
Expand description

Painted properties, RESOLVED (hex colours, px numbers, shadow layers, family names). Painters never read the theme; they paint this.

Fields§

§background_color: Option<String>§background_gradient: Option<Gradient>§color: Option<String>§border_width: Option<f32>

The uniform border width (borderWidth); per-side widths are in border_widths when any side differs.

§border_widths: Option<[f32; 4]>

[top, right, bottom, left] when a per-side width is set.

§border_color: Option<String>§border_style: Option<String>

solid | dashed | dotted (solid when unset).

§border_radius: Option<f32>

The uniform radius in px (a % resolves against the laid-out box).

§corner_radii: Option<[f32; 4]>

[topLeft, topRight, bottomRight, bottomLeft] when a corner is set.

§opacity: Option<f32>§box_shadow: Option<Vec<ShadowLayer>>§font_size: Option<f32>§font_weight: Option<u16>§line_height: Option<f32>§font_family: Option<String>§text_align: Option<String>

PHYSICAL: left | right | center | justify (start/end resolved by the surface direction).

§letter_spacing: Option<f32>§text_decoration: Option<String>

none | underline | line-through

§text_transform: Option<String>

none | uppercase | lowercase | capitalize

§font_style: Option<String>

normal | italic

§padding_horizontal: Option<f32>

The recipe’s padding on a MEASURED leaf (a Button’s label inset): the painter draws it, the measurer includes it; taffy never sees it. The averages of the two sides; padding has each side.

§padding_vertical: Option<f32>§padding: Option<[f32; 4]>

A leaf’s padding [top, right, bottom, left] (logical keys resolved).

§gap: Option<f32>§native: bool

native: true on the part’s recipe: the painter may use the platform’s own control (geometry still from the tokens).

§overflow_hidden: bool§overflow_scroll: bool§overflow_x: Option<String>

Per axis: visible | hidden | clip | scroll | auto (overflow merged).

§overflow_y: Option<String>§transform: Option<Vec<TransformOp>>

Paint-only transform functions in source order.

§transition: Option<Transition>§visibility_hidden: bool

visibility: hidden: the box stays, nothing paints, out of the a11y tree.

§display_none: bool

VAPP-126: display: none (a base style or a matching media block). The node stays in the tree, laid out at zero size with its subtree; a painter clips it, so a control inside draws nothing past the box.

§pointer_events_none: bool

pointerEvents: none: presses pass through.

§user_select: Option<String>§cursor: Option<String>§series_colors: Option<Vec<String>>

A Chart’s series (or slice) colours, resolved for the mode.

§direction: Option<String>

Round 2: a LEAF’s resolved direction (ltr | rtl): the bidi paragraph direction its text is shaped with.

§backdrop_blur: Option<f32>

Round 2: backdropBlur in px ($blur.* resolved): blur what is behind the box through its translucent background. No platform blur = paint the background alone.

§animation: Option<VisualAnimation>

Round 2: the keyframe animation with its resolved timing; a painter keeps the time the node entered the tree and paints crate::animation::frame_with_timing.

§sticky: bool

Round 2: position: sticky (the pinned offsets are LayoutOutput::sticky).

Trait Implementations§

Source§

impl Clone for Visual

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Visual

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Visual

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Visual

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Visual

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Visual

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Visual

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.