pub struct ComputedStyle {Show 23 fields
pub style: Style,
pub relayout_boundary: bool,
pub visuals: Option<Visuals>,
pub text: Option<TextStyle>,
pub opacity: Option<f32>,
pub z_index: Option<i32>,
pub interaction: Option<Interaction>,
pub state_visuals: Option<StateVisuals>,
pub transitions: Vec<TransitionSpec>,
pub scrollbar: Option<ScrollbarStyle>,
pub image_fit: Option<ImageFit>,
pub input_paint: Option<TextInputPaint>,
pub caret_width: Option<CaretWidth>,
pub password_character: Option<PasswordCharacter>,
pub caret_blink_ms: Option<u32>,
pub track: Option<TrackStyle>,
pub checkbox: Option<CheckboxStyle>,
pub radio: Option<RadioStyle>,
pub tab_button: Option<TabButtonStyle>,
pub progress_chunk: Option<ProgressChunk>,
pub popup_gap: Option<PopupGap>,
pub knob_geometry: Option<KnobGeometry>,
pub knob_fill: Color,
}Expand description
Every style component one element carries, computed from its resolved
attributes. None is a component it does not carry.
Fields§
§style: StyleLayout.
relayout_boundary: boolWhether layout may stop its dirty walk at this element.
visuals: Option<Visuals>Paint.
text: Option<TextStyle>Text.
opacity: Option<f32>Opacity; absent is fully opaque.
z_index: Option<i32>Sibling paint order.
interaction: Option<Interaction>Hover / press tints, focus rings, state borders.
state_visuals: Option<StateVisuals>:hover / :focus / :active / :drag-over / :disabled patches.
transitions: Vec<TransitionSpec>The transition declarations.
scrollbar: Option<ScrollbarStyle>Overlay scrollbar styling.
image_fit: Option<ImageFit>fit for an image.
input_paint: Option<TextInputPaint>Caret and selected-glyph paint of a text field.
caret_width: Option<CaretWidth>Caret width of a text field.
password_character: Option<PasswordCharacter>Mask character of a text field.
caret_blink_ms: Option<u32>caret-blink, which lands on the one shared blink clock.
track: Option<TrackStyle>A <toggle> / <switch> track palette.
checkbox: Option<CheckboxStyle>A <checkbox>’s checked fill.
radio: Option<RadioStyle>A <radio>’s selected fill.
A tab strip button’s palette.
progress_chunk: Option<ProgressChunk>An indeterminate <progress>’s sweep width.
popup_gap: Option<PopupGap>The gap a dropdown’s panel opens at.
knob_geometry: Option<KnobGeometry>Knob and thumb geometry of a <toggle> / <switch> / <slider>.
knob_fill: ColorKnob and thumb fill.
Implementations§
Source§impl ComputedStyle
impl ComputedStyle
Sourcepub fn new(ctx: &StyleContext<'_>, attrs: &Attributes) -> Self
pub fn new(ctx: &StyleContext<'_>, attrs: &Attributes) -> Self
Compute the style components of an element from its resolved attributes.
Sourcepub fn insert(self, ent: &mut EntityWorldMut<'_>)
pub fn insert(self, ent: &mut EntityWorldMut<'_>)
Insert every component onto a freshly spawned element.
Sourcepub fn commit(self, ent: &mut EntityWorldMut<'_>, animate: bool)
pub fn commit(self, ent: &mut EntityWorldMut<'_>, animate: bool)
Replace a live element’s style components with these.
A component this does not carry is removed, so a property nothing
sets any more goes back to its initial value. A value a runtime
system holds in StyleOverrides stays on top, and the cascade’s
new value becomes what it falls back to when the system lets go.
A property with a transition tweens from what is on screen to its
new value when animate; a tween already running is retargeted
from where it is. Each component is written only when it changed,
so an unchanged restyle marks nothing changed.
Trait Implementations§
Source§impl Clone for ComputedStyle
impl Clone for ComputedStyle
Source§fn clone(&self) -> ComputedStyle
fn clone(&self) -> ComputedStyle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more