pub struct ViewStyle {Show 28 fields
pub background_color: Color,
pub border_radius: Points,
pub corner_radius: Corners<Option<Points>>,
pub continuous_corners: bool,
pub borders: Borders,
pub opacity: f32,
pub overflow_hidden: bool,
pub transform: Transform,
pub tint_color: Option<Color>,
pub accent_color: Option<Color>,
pub elevation: Points,
pub transform_origin: TransformOrigin,
pub object_position: ObjectPosition,
pub backface_hidden: bool,
pub effects: Option<Arc<Effects>>,
pub blend_mode: BlendMode,
pub backdrop_material: BackdropMaterial,
pub glass_effect: GlassEffect,
pub glass_tint_color: Option<Color>,
pub macos_backdrop: Option<MacOsBackdrop>,
pub windows_backdrop: Option<WindowsBackdrop>,
pub outline: Outline,
pub hidden: bool,
pub cursor: Cursor,
pub transition: Option<Transition>,
pub animation: Option<KeyframeAnimation>,
pub shows_label: bool,
pub label_arrow_only: bool,
}Expand description
Visual (non-layout) properties of a native view.
Fields§
§background_color: ColorBackground fill.
border_radius: PointsborderRadius: the radius of corners without their own.
corner_radius: Corners<Option<Points>>borderTopLeftRadius etc.; they override border_radius.
continuous_corners: boolborderCurve: "continuous".
borders: BordersBorders (their widths also affect layout).
opacity: f32Opacity in 0.0..=1.0.
Clip children to the (rounded) bounds.
transform: TransformStatic transform, around the view’s center.
tint_color: Option<Color>tintColor: recolors an image’s opaque pixels.
accent_color: Option<Color>accentColor: the color a system control shows its state in, which
a native component gets as its accentColor prop (a system switch’s
track when on, for example); the control’s own when None.
elevation: PointsAndroid’s material shadow: the node’s android={{ elevation }} prop,
not a style.
transform_origin: TransformOrigintransformOrigin: the point transforms act around.
object_position: ObjectPositionobjectPosition: where an image sits in its box (image views; the
platforms take it from crate::mount::ImageOptions::position).
backfaceVisibility: "hidden": invisible when turned away.
effects: Option<Arc<Effects>>Layered / inset shadows, gradients and filters.
blend_mode: BlendModemixBlendMode.
backdrop_material: BackdropMaterialThe iOS material from ios={{ backdropMaterial }}, projected at mount time.
glass_effect: GlassEffectglassEffect.
glass_tint_color: Option<Color>glassTintColor: the tint of glassEffect’s native material.
macos_backdrop: Option<MacOsBackdrop>The macOS backdrop from macos={{ backdrop }}, projected at mount time.
windows_backdrop: Option<WindowsBackdrop>The Windows backdrop from windows={{ backdrop }}, projected at
mount time.
outline: Outlineoutline*.
visibility: "hidden": not drawn and not touchable, still laid out.
cursor: Cursorcursor.
transition: Option<Transition>transition*: style changes animate.
animation: Option<KeyframeAnimation>animation*: a keyframe animation runs.
shows_label: boolIn a terminal, the layout gave the view one row of its
accessibility label in place of its content (an icon button whose
icon a terminal leaves out): the platform draws the label there, and
on no other view. Not a style: the core sets it at mount time,
always false off a terminal.
label_arrow_only: boolIn a terminal, the label the layout gave the view
(Self::shows_label) is a popup trigger’s arrow alone (▾): the
words it is flush against (a split button’s main action) say what
it opens. Another popup trigger’s label is its name and the arrow.
Not a style: the core sets it at mount time, always false off a
terminal.