diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-12-14 10:09:44 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-12-14 10:09:44 +0100 |
| commit | 9ba4d2c134479aad876a0e2ac4cd1622a353109e (patch) | |
| tree | a94e0e6ae53a1ba440e869fca26cc2ea0b179057 /library/src/layout/container.rs | |
| parent | 4c73456fc1f5df8ebb3a89d9db657c3c54624d66 (diff) | |
New macro setup
Diffstat (limited to 'library/src/layout/container.rs')
| -rw-r--r-- | library/src/layout/container.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/library/src/layout/container.rs b/library/src/layout/container.rs index 0b035273..85257715 100644 --- a/library/src/layout/container.rs +++ b/library/src/layout/container.rs @@ -2,6 +2,8 @@ use super::VNode; use crate::prelude::*; /// An inline-level container that sizes content. +#[func] +#[capable(Layout, Inline)] #[derive(Debug, Hash)] pub struct BoxNode { /// How to size the content horizontally and vertically. @@ -10,7 +12,7 @@ pub struct BoxNode { pub body: Content, } -#[node(Layout, Inline)] +#[node] impl BoxNode { fn construct(_: &Vm, args: &mut Args) -> SourceResult<Content> { let width = args.named("width")?; @@ -60,10 +62,12 @@ impl Layout for BoxNode { impl Inline for BoxNode {} /// A block-level container that places content into a separate flow. +#[func] +#[capable(Layout)] #[derive(Debug, Hash)] pub struct BlockNode(pub Content); -#[node(Layout)] +#[node] impl BlockNode { /// The spacing between the previous and this block. #[property(skip)] |
