Skip to main content

Style

Struct Style 

Source
pub struct Style {
Show 71 fields pub background_color: Color, pub background_image: Option<GradientStack>, pub border_bottom_color: Color, pub border_bottom_left_radius: Length, pub border_bottom_right_radius: Length, pub border_bottom_width: Length, pub border_left_color: Color, pub border_left_width: Length, pub border_right_color: Color, pub border_right_width: Length, pub border_top_color: Color, pub border_top_left_radius: Length, pub border_top_right_radius: Length, pub border_top_width: Length, pub bottom: Unit, pub box_shadow: Option<Arc<[BoxShadow]>>, pub child_between: Unit, pub child_bottom: Unit, pub child_left: Unit, pub child_right: Unit, pub child_top: Unit, pub color: Color, pub display: Option<Direction>, pub flex_basis: Length, pub font_family: Option<Arc<str>>, pub font_size: f32, pub font_style: FontStyle, pub font_weight: f32, pub font_width: f32, pub height: Unit, pub left: Unit, pub letter_spacing: Option<Unit>, pub line_height: Unit, pub max_bottom: Option<Length>, pub max_child_between: Option<Length>, pub max_child_bottom: Option<Length>, pub max_child_left: Option<Length>, pub max_child_right: Option<Length>, pub max_child_top: Option<Length>, pub max_height: Option<Length>, pub max_left: Option<Length>, pub max_right: Option<Length>, pub max_top: Option<Length>, pub max_width: Option<Length>, pub min_bottom: Option<Length>, pub min_child_between: Option<Length>, pub min_child_bottom: Option<Length>, pub min_child_left: Option<Length>, pub min_child_right: Option<Length>, pub min_child_top: Option<Length>, pub min_height: Option<Length>, pub min_left: Option<Length>, pub min_right: Option<Length>, pub min_top: Option<Length>, pub min_width: Option<Length>, pub opacity: f32, pub outline_color: Color, pub outline_offset: Length, pub outline_width: Length, pub position: Position, pub right: Unit, pub selection_background: Color, pub selection_color: Option<Color>, pub text_align: TextAlign, pub text_shadow: Option<Arc<[TextShadow]>>, pub top: Unit, pub transform: Affine, pub visibility: bool, pub width: Unit, pub word_spacing: Option<Unit>, pub z_index: i32,
}
Expand description

Computed style properties of a Node.

The Ui::on_style callback gives an application the opportunity to modify a node’s style after CSS rules have been applied and before rendering.

Fields§

§background_color: Color§background_image: Option<GradientStack>§border_bottom_color: Color§border_bottom_left_radius: Length§border_bottom_right_radius: Length§border_bottom_width: Length§border_left_color: Color§border_left_width: Length§border_right_color: Color§border_right_width: Length§border_top_color: Color§border_top_left_radius: Length§border_top_right_radius: Length§border_top_width: Length§bottom: Unit§box_shadow: Option<Arc<[BoxShadow]>>§child_between: Unit§child_bottom: Unit§child_left: Unit§child_right: Unit§child_top: Unit§color: Color§display: Option<Direction>§flex_basis: Length§font_family: Option<Arc<str>>§font_size: f32§font_style: FontStyle§font_weight: f32§font_width: f32§height: Unit§left: Unit§letter_spacing: Option<Unit>§line_height: Unit§max_bottom: Option<Length>§max_child_between: Option<Length>§max_child_bottom: Option<Length>§max_child_left: Option<Length>§max_child_right: Option<Length>§max_child_top: Option<Length>§max_height: Option<Length>§max_left: Option<Length>§max_right: Option<Length>§max_top: Option<Length>§max_width: Option<Length>§min_bottom: Option<Length>§min_child_between: Option<Length>§min_child_bottom: Option<Length>§min_child_left: Option<Length>§min_child_right: Option<Length>§min_child_top: Option<Length>§min_height: Option<Length>§min_left: Option<Length>§min_right: Option<Length>§min_top: Option<Length>§min_width: Option<Length>§opacity: f32§outline_color: Color§outline_offset: Length§outline_width: Length§position: Position§right: Unit§selection_background: Color§selection_color: Option<Color>

If selection_color is None, selected text will not have a different color.

§text_align: TextAlign§text_shadow: Option<Arc<[TextShadow]>>§top: Unit§transform: Affine§visibility: bool§width: Unit§word_spacing: Option<Unit>§z_index: i32

Implementations§

Trait Implementations§

Source§

impl Clone for Style

Source§

fn clone(&self) -> Style

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 Style

Source§

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

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

impl Default for Style

Source§

fn default() -> Self

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

impl PartialEq for Style

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Style

Auto Trait Implementations§

§

impl Freeze for Style

§

impl RefUnwindSafe for Style

§

impl Send for Style

§

impl Sync for Style

§

impl Unpin for Style

§

impl UnsafeUnpin for Style

§

impl UnwindSafe for Style

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> AnyEq for T
where T: Any + PartialEq,

Source§

fn equals(&self, other: &(dyn Any + 'static)) -> bool

Source§

fn as_any(&self) -> &(dyn Any + 'static)

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> Brush for T
where T: Clone + PartialEq + Default + Debug,

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> Downcast<T> for T

Source§

fn downcast(&self) -> &T

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,