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 the font

Sets the foreground color

Sets padding

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 the margins

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 text size

Sets the way text wraps

Sets the preferred width

Sets the preferred width to Size::Fill(1)

Sets the preferred height

Sets the preferred height to Size::Fill(1)

Sets the direction for layouting

Sets the horizontal alignment

Sets the vertical alignment

Adds a flag to the stylesheet

Removes a flag from the stylesheet

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.