pub struct Style { /* private fields */ }Expand description
Styling map for defining widget appearance.
Implementations§
Source§impl Style
impl Style
Sourcepub fn from_values(
values: impl IntoIterator<Item = (&'static str, StyleVal)>,
) -> Self
pub fn from_values( values: impl IntoIterator<Item = (&'static str, StyleVal)>, ) -> Self
Create a style from an array of strings and style values.
Sourcepub fn with_value(self, name: &'static str, value: StyleVal) -> Self
pub fn with_value(self, name: &'static str, value: StyleVal) -> Self
Insert a style value with the given name into the style map and return the new style.
Sourcepub fn get(&self, name: &'static str) -> Option<StyleVal>
pub fn get(&self, name: &'static str) -> Option<StyleVal>
Get a style value by name. Returns None if the value name does not exist.
Sourcepub fn get_color(&self, name: &'static str) -> Option<Color>
pub fn get_color(&self, name: &'static str) -> Option<Color>
Get a color style value by name. Returns None if the value name does not exist.
Sourcepub fn get_gradient(&self, name: &'static str) -> Option<Gradient>
pub fn get_gradient(&self, name: &'static str) -> Option<Gradient>
Get a gradient style value by name. Returns None if the value name does not exist.
Sourcepub fn get_brush(&self, name: &'static str) -> Option<Brush>
pub fn get_brush(&self, name: &'static str) -> Option<Brush>
Get a brush style value by name. Returns None if the value name does not exist.
Sourcepub fn get_float(&self, name: &'static str) -> Option<f32>
pub fn get_float(&self, name: &'static str) -> Option<f32>
Get a float style value by name. Returns None if the value name does not exist.
Sourcepub fn get_int(&self, name: &'static str) -> Option<i32>
pub fn get_int(&self, name: &'static str) -> Option<i32>
Get an int style value by name. Returns None if the value name does not exist.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Style
impl !RefUnwindSafe for Style
impl !Send for Style
impl !Sync for Style
impl Unpin for Style
impl !UnwindSafe for Style
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
Mutably borrows from an owned value. Read more