Modifier

Struct Modifier 

Source
pub struct Modifier {
Show 27 fields pub padding: Option<f32>, pub size: Option<Size>, pub fill_max: bool, pub background: Option<Color>, pub border: Option<Border>, pub flex_grow: Option<f32>, pub flex_shrink: Option<f32>, pub flex_basis: Option<f32>, pub align_self: Option<AlignSelf>, pub aspect_ratio: Option<f32>, pub position_type: Option<PositionType>, pub offset_left: Option<f32>, pub offset_right: Option<f32>, pub offset_top: Option<f32>, pub offset_bottom: Option<f32>, pub grid: Option<GridConfig>, pub grid_col_span: Option<u16>, pub grid_row_span: Option<u16>, pub click: bool, pub semantics_label: Option<String>, pub z_index: f32, pub clip_rounded: Option<f32>, pub on_pointer_down: Option<Rc<dyn Fn(PointerEvent)>>, pub on_pointer_move: Option<Rc<dyn Fn(PointerEvent)>>, pub on_pointer_up: Option<Rc<dyn Fn(PointerEvent)>>, pub on_pointer_enter: Option<Rc<dyn Fn(PointerEvent)>>, pub on_pointer_leave: Option<Rc<dyn Fn(PointerEvent)>>,
}

Fields§

§padding: Option<f32>§size: Option<Size>§fill_max: bool§background: Option<Color>§border: Option<Border>§flex_grow: Option<f32>§flex_shrink: Option<f32>§flex_basis: Option<f32>§align_self: Option<AlignSelf>§aspect_ratio: Option<f32>§position_type: Option<PositionType>§offset_left: Option<f32>§offset_right: Option<f32>§offset_top: Option<f32>§offset_bottom: Option<f32>§grid: Option<GridConfig>§grid_col_span: Option<u16>§grid_row_span: Option<u16>§click: bool§semantics_label: Option<String>§z_index: f32§clip_rounded: Option<f32>§on_pointer_down: Option<Rc<dyn Fn(PointerEvent)>>§on_pointer_move: Option<Rc<dyn Fn(PointerEvent)>>§on_pointer_up: Option<Rc<dyn Fn(PointerEvent)>>§on_pointer_enter: Option<Rc<dyn Fn(PointerEvent)>>§on_pointer_leave: Option<Rc<dyn Fn(PointerEvent)>>

Implementations§

Source§

impl Modifier

Source

pub fn new() -> Self

Source

pub fn padding(self, px: f32) -> Self

Source

pub fn size(self, w: f32, h: f32) -> Self

Source

pub fn fill_max_size(self) -> Self

Source

pub fn background(self, color: Color) -> Self

Source

pub fn border(self, width: f32, color: Color, radius: f32) -> Self

Source

pub fn clickable(self) -> Self

Source

pub fn semantics(self, label: impl Into<String>) -> Self

Source

pub fn z_index(self, z: f32) -> Self

Source

pub fn clip_rounded(self, r: f32) -> Self

Source

pub fn on_pointer_down(self, f: impl Fn(PointerEvent) + 'static) -> Self

Source

pub fn on_pointer_move(self, f: impl Fn(PointerEvent) + 'static) -> Self

Source

pub fn on_pointer_up(self, f: impl Fn(PointerEvent) + 'static) -> Self

Source

pub fn on_pointer_enter(self, f: impl Fn(PointerEvent) + 'static) -> Self

Source

pub fn on_pointer_leave(self, f: impl Fn(PointerEvent) + 'static) -> Self

Source

pub fn flex_grow(self, g: f32) -> Self

Source

pub fn flex_shrink(self, s: f32) -> Self

Source

pub fn flex_basis(self, px: f32) -> Self

Source

pub fn align_self_baseline(self) -> Self

Source

pub fn align_self_center(self) -> Self

Source

pub fn aspect_ratio(self, ratio: f32) -> Self

Source

pub fn absolute(self) -> Self

Source

pub fn offset( self, left: Option<f32>, top: Option<f32>, right: Option<f32>, bottom: Option<f32>, ) -> Self

Source

pub fn grid(self, columns: usize, row_gap: f32, column_gap: f32) -> Self

Source

pub fn grid_span(self, col_span: u16, row_span: u16) -> Self

Trait Implementations§

Source§

impl Clone for Modifier

Source§

fn clone(&self) -> Modifier

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Modifier

Source§

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

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

impl Default for Modifier

Source§

fn default() -> Modifier

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

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