macro_rules! impl_state_builders {
($widget:ty) => { ... };
}Expand description
Generate builder methods for widgets with state: WidgetState field.
This macro generates the following methods:
focused(self, bool) -> Self- Set focused statedisabled(self, bool) -> Self- Set disabled statefg(self, Color) -> Self- Set foreground colorbg(self, Color) -> Self- Set background coloris_focused(&self) -> bool- Check if focusedis_disabled(&self) -> bool- Check if disabledset_focused(&mut self, bool)- Mutably set focused state
§Example
ⓘ
struct MyWidget {
state: WidgetState,
props: WidgetProps,
}
impl_state_builders!(MyWidget);