summaryrefslogtreecommitdiffstats
path: root/style/src/theme.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-01-10 02:58:40 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-01-10 10:01:50 +0100
commit81ecc4a67f7982c6300a4d5e8ec4e8aac8cbd881 (patch)
treef3fb8851b62008f8349036ec2aae50a7fc303257 /style/src/theme.rs
parenta79b2adf5c3e345667341451a4aaaa14fc9bfe80 (diff)
downloadiced-81ecc4a67f7982c6300a4d5e8ec4e8aac8cbd881.tar.gz
iced-81ecc4a67f7982c6300a4d5e8ec4e8aac8cbd881.tar.bz2
iced-81ecc4a67f7982c6300a4d5e8ec4e8aac8cbd881.zip
Add basic controls to `layout` example
Diffstat (limited to '')
-rw-r--r--style/src/theme.rs6
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))