Struct pixel_widgets::style::builder::RuleBuilder [−][src]
pub struct RuleBuilder { /* fields omitted */ }
Expand description
Builder that adds style declarations to a selected rule.
Implementations
Constructs a new RuleBuilder
for the given selector.
The selector must follow the same syntax as the .pwss file format.
Panics if the selector can’t be parsed.
use pixel_widgets::prelude::*;
// Sets the background of the first direct child of any window widget
RuleBuilder::new("window > * :nth-child(0)").background_color(Color::red());
Clears the background
Sets the background to a color
Sets the background to a colored image
Sets the background to a colored patch
Sets all padding values to the same value
Sets horizontal padding values to the same value
Sets vertical padding values to the same value
Sets left padding
Sets right padding
Sets top padding
Sets bottom padding
Sets all margin values to the same value
Sets horizontal margin values to the same value
Sets vertical margin values to the same value
Sets the left margin
Sets the right margin
Sets the top margin
Sets the bottom margin
Sets the preferred width to Size::Fill(1)
Sets the preferred height to Size::Fill(1)
Sets the direction for layouting
Sets the horizontal alignment
Sets the vertical alignment
Removes a flag from the stylesheet