summaryrefslogtreecommitdiff
path: root/library/src/layout/container.rs
diff options
context:
space:
mode:
Diffstat (limited to 'library/src/layout/container.rs')
-rw-r--r--library/src/layout/container.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/library/src/layout/container.rs b/library/src/layout/container.rs
index 62e129b4..112c6f03 100644
--- a/library/src/layout/container.rs
+++ b/library/src/layout/container.rs
@@ -50,6 +50,13 @@ impl BoxNode {
let body = args.eat::<Content>()?.unwrap_or_default();
Ok(Self { sizing: Axes::new(width, height), body }.pack())
}
+
+ fn field(&self, name: &str) -> Option<Value> {
+ match name {
+ "body" => Some(Value::Content(self.body.clone())),
+ _ => None,
+ }
+ }
}
impl Layout for BoxNode {
@@ -163,6 +170,13 @@ impl BlockNode {
args.named("below")?.map(VNode::block_around).or(spacing),
);
}
+
+ fn field(&self, name: &str) -> Option<Value> {
+ match name {
+ "body" => Some(Value::Content(self.0.clone())),
+ _ => None,
+ }
+ }
}
impl Layout for BlockNode {