Struct pixel_widgets::style::builder::StyleBuilder [−][src]
pub struct StyleBuilder { /* fields omitted */ }
Expand description
Builds a style.
Implementations
Add a rule defined in a RuleBuilder
to the StyleBuilder
.
Prepend the given selector to all rules in this StyleBuilder
.
Merge with another StyleBuilder
.
Include the scoped style of a Component
in this StyleBuilder
.
pub async fn from_read_fn<P, R>(path: P, read: R) -> Result<Self> where
P: AsRef<Path>,
R: ReadFn,
pub async fn from_read_fn<P, R>(path: P, read: R) -> Result<Self> where
P: AsRef<Path>,
R: ReadFn,
Asynchronously load a stylesheet from a .pwss file. See the style module documentation on how to write .pwss files.
Synchronously load a stylesheet from a .pwss file. See the style module documentation on how to write .pwss files.
Returns an ImageId
for the key
.
When the style is built, the image is loaded using the closure.
Returns a PatchId
for the key
.
When the style is built, the 9-patch is loaded using the closure.
Returns a FontId
for the key
.
When the style is built, the font is loaded using the closure.
The closure must return the bytes of a .ttf file.
Returns an ImageId
for the key
.
When the style is built, the image is loaded by awaiting the future.
Returns a PatchId
for the key
.
When the style is built, the 9-patch is loaded by awaiting the future.
Returns a FontId
for the key
.
When the style is built, the font is loaded by awaiting the future.
The future must output the bytes of a .ttf file.
Builds the Style
. All loading of images, 9 patches and fonts happens in this method.
If any of them fail, an error is returned.
Trait Implementations
Returns the “default value” for a type. Read more