From 81ecc4a67f7982c6300a4d5e8ec4e8aac8cbd881 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 10 Jan 2024 02:58:40 +0100 Subject: Add basic controls to `layout` example --- style/src/theme.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'style/src/theme.rs') 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>), } +impl From for Container { + fn from(appearance: container::Appearance) -> Self { + Self::Custom(Box::new(move |_: &_| appearance)) + } +} + impl container::Appearance + 'static> From for Container { fn from(f: T) -> Self { Self::Custom(Box::new(f)) -- cgit