diff options
Diffstat (limited to 'style/src/theme.rs')
-rw-r--r-- | style/src/theme.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/style/src/theme.rs b/style/src/theme.rs index 47010728..eafb0b47 100644 --- a/style/src/theme.rs +++ b/style/src/theme.rs @@ -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)) |