Skip to main content

StyleProps

Struct StyleProps 

Source
pub struct StyleProps {
Show 23 fields pub fill: Option<ColorRef>, pub text: Option<ColorRef>, pub border_color: Option<ColorRef>, pub border_width: Option<f32>, pub radius: Option<Metric>, pub padding: Option<Bounds>, pub font: Option<String>, pub opacity: Option<f32>, pub transition: Option<Metric>, pub shadow: Option<String>, pub material: Option<String>, pub reveal: Option<String>, pub reveal_color: Option<ColorRef>, pub reveal_radius: Option<f32>, pub text_case: Option<String>, pub letter_spacing: Option<f32>, pub border_sides: Option<Bounds>, pub border_style: Option<String>, pub line_height: Option<f32>, pub font_weight: Option<FontWeight>, pub font_size: Option<f32>, pub italic: Option<bool>, pub gap: Option<f32>,
}
Expand description

Um conjunto parcial de propriedades visuais. None = não altera.

Fields§

§fill: Option<ColorRef>§text: Option<ColorRef>§border_color: Option<ColorRef>§border_width: Option<f32>§radius: Option<Metric>

Token procurado em Theme::radius.

§padding: Option<Bounds>§font: Option<String>

Nome em Theme::fonts.

§opacity: Option<f32>§transition: Option<Metric>

Duração da transição entre estados; token procurado em Theme::durations.

§shadow: Option<String>

Sombra; token procurado em Theme::shadows ("none" tira a sombra).

§material: Option<String>

Material do fundo: glass (Liquid Glass: desfoca o que está atrás, com brilho e borda de luz), frosted (vidro fosco, como o Acrylic) ou none.

§reveal: Option<String>

O Reveal Highlight (o efeito do Fluent): uma luz que segue o mouse. border acende a borda dos controles perto dele, background acende o fundo do controle sob ele, both os dois, none desliga.

§reveal_color: Option<ColorRef>

A cor da luz do Reveal (sem ela: branca no tema escuro, escura no claro; o token reveal do tema, se houver).

§reveal_radius: Option<f32>

Até onde a luz do Reveal alcança, em unidades lógicas (o padrão, 96).

§text_case: Option<String>

Maiúsculas ou minúsculas no texto (upper, lower, none; o text-transform do CSS).

§letter_spacing: Option<f32>

Espaço a mais entre as letras, em pixels (o letter-spacing do CSS).

§border_sides: Option<Bounds>

A largura da borda de cada lado (esquerda, cima, direita, baixo), no lugar da border_width (o border-bottom do CSS).

§border_style: Option<String>

O traço da borda: solid (o padrão), dashed ou dotted.

§line_height: Option<f32>

A altura da linha do texto quebrado, em vezes o tamanho da fonte (o line-height do CSS: 1.5). O relatório do Tabernáculo, T04.

§font_weight: Option<FontWeight>

Troca só o peso, só o tamanho ou só o itálico da fonte herdada (do font do estilo, ou da default), sem nomear uma fonte nova (T05).

§font_size: Option<f32>§italic: Option<bool>§gap: Option<f32>

O espaço entre as partes de um controle feito de várias (os botões do ButtonGroup, a marcação do SegmentedControl até a borda), em pixels: 0 cola (o relatório do Tabernáculo, C38). Sem ele, o de cada controle.

Implementations§

Source§

impl StyleProps

Source

pub fn new() -> Self

Source

pub fn fill(self, c: impl Into<ColorRef>) -> Self

Source

pub fn text(self, c: impl Into<ColorRef>) -> Self

Source

pub fn border(self, c: impl Into<ColorRef>, width: f32) -> Self

Source

pub fn radius(self, m: impl Into<Metric>) -> Self

Source

pub fn padding(self, b: impl Into<Bounds>) -> Self

Source

pub fn font(self, name: &str) -> Self

Source

pub fn opacity(self, v: f32) -> Self

Source

pub fn transition(self, m: impl Into<Metric>) -> Self

Source

pub fn shadow(self, token: &str) -> Self

Source

pub fn material(self, name: &str) -> Self

glass, frosted ou none (veja Material).

Source

pub fn reveal(self, mode: &str) -> Self

border, background, both ou none (veja Reveal).

Source

pub fn merge(&mut self, other: &StyleProps)

Copia para self tudo que está definido em other.

Trait Implementations§

Source§

impl Clone for StyleProps

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 StyleProps

Source§

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

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

impl Default for StyleProps

Source§

fn default() -> Self

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

impl PartialEq for StyleProps

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 StructuralPartialEq for StyleProps

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

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.