Module pix_engine::gui::theme
source · Expand description
UI theme methods.
Provides various methods for changing and querying the current UI theme used to render text and UI widgets.
Example
fn on_update(&mut self, s: &mut PixState) -> PixResult<()> {
s.fill(Color::CADET_BLUE); // Change text color
s.font_size(14)?;
s.font_style(FontStyle::BOLD);
s.font_family(Font::INCONSOLATA)?;
s.text("Blue, bold, size 14 text in Inconsolata font")?;
Ok(())
}
Structs
- A set of Colors for theming UI elements.
- Represents a font family name along with the font glyph source.
- A set of
FontStyle
s for body, heading, and monospace text. - A set of font families for body, heading, and monospace text.
- A set of styles for sizing, padding, borders, etc for theming UI elements.
- Builds a Spacing instance by customizing various space and padding settings.
- A UI
Theme
containing font families, sizes, styles, and colors. - A builder to generate custom Themes.
Enums
- Represents a given color-themed section in a UI.
- Represents a given font-themed section in a UI.