pub struct Style {
pub font_size: Option<f32>,
pub bold: Option<bool>,
pub color: Option<String>,
pub background: Option<String>,
pub border_color: Option<String>,
pub border_width: Option<f32>,
pub borders: Option<String>,
pub padding: Option<f32>,
pub text_align: Option<TextAlign>,
pub vertical_align: Option<VerticalAlign>,
pub word_wrap: Option<bool>,
}Expand description
Appearance settings. Every field is optional so styles can be layered: built-in defaults, then a named style, then the control’s own settings, then conditional rules.
Fields§
§font_size: Option<f32>Font size in points.
bold: Option<bool>Bold text.
color: Option<String>Text color, #rrggbb or #rrggbbaa.
background: Option<String>Fill color.
border_color: Option<String>Border color.
border_width: Option<f32>Border width in points; 0 for none.
borders: Option<String>Which sides have a border: any of top, right, bottom, left, or all.
padding: Option<f32>Inner padding in points.
text_align: Option<TextAlign>Horizontal alignment.
vertical_align: Option<VerticalAlign>Vertical alignment.
word_wrap: Option<bool>Wraps long text onto more lines (true by default).
Implementations§
Source§impl Style
impl Style
Sourcepub fn background(self, color: &str) -> Self
pub fn background(self, color: &str) -> Self
Sets the fill color (#rrggbb).
Sourcepub fn border(self, sides: &str, width: f32, color: &str) -> Self
pub fn border(self, sides: &str, width: f32, color: &str) -> Self
Adds a border of width points in color on sides (all, bottom, top bottom…).
Sourcepub fn valign(self, align: VerticalAlign) -> Self
pub fn valign(self, align: VerticalAlign) -> Self
Sets the vertical alignment.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Style
impl<'de> Deserialize<'de> for Style
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Style
Auto Trait Implementations§
impl Freeze for Style
impl RefUnwindSafe for Style
impl Send for Style
impl Sync for Style
impl Unpin for Style
impl UnsafeUnpin 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