Macro freya::hooks::theme_with
source · macro_rules! theme_with { ($theme_name:ident { $( $theme_field_name:ident: $theme_field_val:expr ),* $(,)? }) => { ... }; }
Expand description
Create FooThemeWith
structs without having to deal with the verbose syntax.
Examples
Without the macro:
render! {
Button {
theme: ButtonThemeWith {
background: Some("blue".into()),
font_theme: FontThemeWith {
color: Some("white".into()),
..Default::default()
}.into(),
..Default::default()
}
}
}
With the macro:
render! {
Button {
theme: theme_with!(ButtonTheme {
background: "blue".into(),
font_theme: theme_with!(FontTheme {
color: "white".into(),
}),
})
}
}