pub struct StyleValues {
pub display: Option<Display>,
pub position: Option<Position>,
pub inset: Option<Edges>,
pub width: Option<Length>,
pub height: Option<Length>,
pub min_height: Option<Length>,
pub fill: Option<Option<Fill>>,
pub shadows: Option<Vec<ShadowSpec>>,
pub border: Option<Option<Border>>,
pub opacity: Option<Option<f32>>,
pub text_color: Option<Color>,
}Expand description
A value for some of the StyleFields; None leaves a field out.
Fields§
§display: Option<Display>Style::display.
position: Option<Position>Style::position.
inset: Option<Edges>Style::inset.
width: Option<Length>Style::width.
height: Option<Length>Style::height.
min_height: Option<Length>Style::min_height.
fill: Option<Option<Fill>>Visuals::fill.
shadows: Option<Vec<ShadowSpec>>Visuals::shadows.
border: Option<Option<Border>>Visuals::border.
opacity: Option<Option<f32>>The Opacity component; Some(None) is no component.
text_color: Option<Color>TextStyle::color.
Implementations§
Source§impl StyleValues
impl StyleValues
Sourcepub fn fields(&self) -> StyleFields
pub fn fields(&self) -> StyleFields
The fields this sets.
Sourcepub fn read(fields: StyleFields, live: &Live<'_>) -> Self
pub fn read(fields: StyleFields, live: &Live<'_>) -> Self
Read fields off the live components. A field whose component is
missing is left out, except opacity, whose absence is a value.
Sourcepub fn overlay(&mut self, top: &StyleValues)
pub fn overlay(&mut self, top: &StyleValues)
Lay top over these values: every field it sets wins.
Sourcepub fn restricted(self, fields: StyleFields) -> Self
pub fn restricted(self, fields: StyleFields) -> Self
Keep only fields.
Sourcepub fn write_style(&self, style: &mut impl DerefMut<Target = Style>)
pub fn write_style(&self, style: &mut impl DerefMut<Target = Style>)
Write the layout fields this sets onto style, touching only the
ones that differ so an unchanged value marks nothing changed.
Sourcepub fn write_visuals(&self, visuals: &mut impl DerefMut<Target = Visuals>)
pub fn write_visuals(&self, visuals: &mut impl DerefMut<Target = Visuals>)
Write the paint fields this sets onto visuals, touching only the
ones that differ.
Sourcepub fn write_text(&self, text: &mut impl DerefMut<Target = TextStyle>)
pub fn write_text(&self, text: &mut impl DerefMut<Target = TextStyle>)
Write the text color this sets onto text, if it differs.
Trait Implementations§
Source§impl Clone for StyleValues
impl Clone for StyleValues
Source§fn clone(&self) -> StyleValues
fn clone(&self) -> StyleValues
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StyleValues
impl Debug for StyleValues
Source§impl Default for StyleValues
impl Default for StyleValues
Source§fn default() -> StyleValues
fn default() -> StyleValues
Source§impl PartialEq for StyleValues
impl PartialEq for StyleValues
Source§fn eq(&self, other: &StyleValues) -> bool
fn eq(&self, other: &StyleValues) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for StyleValues
Auto Trait Implementations§
impl Freeze for StyleValues
impl RefUnwindSafe for StyleValues
impl Send for StyleValues
impl Sync for StyleValues
impl Unpin for StyleValues
impl UnsafeUnpin for StyleValues
impl UnwindSafe for StyleValues
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FromTemplate for T
impl<T> FromTemplate for T
§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
§impl<T> Template for T
impl<T> Template for T
§fn build_template(
&self,
_context: &mut TemplateContext<'_, '_>,
) -> Result<<T as Template>::Output, BevyError>
fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>
entity context to produce a Template::Output.§fn clone_template(&self) -> T
fn clone_template(&self) -> T
Clone.