Add basic controls to layout example
This commit is contained in:
parent
a79b2adf5c
commit
81ecc4a67f
3 changed files with 84 additions and 15 deletions
|
|
@ -383,6 +383,12 @@ pub enum Container {
|
|||
Custom(Box<dyn container::StyleSheet<Style = Theme>>),
|
||||
}
|
||||
|
||||
impl From<container::Appearance> for Container {
|
||||
fn from(appearance: container::Appearance) -> Self {
|
||||
Self::Custom(Box::new(move |_: &_| appearance))
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Fn(&Theme) -> container::Appearance + 'static> From<T> for Container {
|
||||
fn from(f: T) -> Self {
|
||||
Self::Custom(Box::new(f))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue