summaryrefslogtreecommitdiff
path: root/library/src/layout/hide.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-02-12 18:58:39 +0100
committerLaurenz <laurmaedje@gmail.com>2023-02-12 19:57:28 +0100
commit3ffa7393f0632d9ee5dd9c821685a1a033d5c0ab (patch)
treeaf09b0683352c4028436a2e5251dce54cf41d4aa /library/src/layout/hide.rs
parentf4856c18b9cf3f6952276cc61b557aebeb2fa651 (diff)
Make all nodes block-level
Diffstat (limited to 'library/src/layout/hide.rs')
-rw-r--r--library/src/layout/hide.rs19
1 files changed, 4 insertions, 15 deletions
diff --git a/library/src/layout/hide.rs b/library/src/layout/hide.rs
index cedc2489..4f46324f 100644
--- a/library/src/layout/hide.rs
+++ b/library/src/layout/hide.rs
@@ -21,7 +21,7 @@ use crate::prelude::*;
/// ## Category
/// layout
#[func]
-#[capable(Layout, Inline)]
+#[capable(Show)]
#[derive(Debug, Hash)]
pub struct HideNode(pub Content);
@@ -39,19 +39,8 @@ impl HideNode {
}
}
-impl Layout for HideNode {
- fn layout(
- &self,
- vt: &mut Vt,
- styles: StyleChain,
- regions: Regions,
- ) -> SourceResult<Fragment> {
- let mut fragment = self.0.layout(vt, styles, regions)?;
- for frame in &mut fragment {
- frame.clear();
- }
- Ok(fragment)
+impl Show for HideNode {
+ fn show(&self, _: &mut Vt, _: &Content, _: StyleChain) -> SourceResult<Content> {
+ Ok(self.0.clone().styled(Meta::DATA, vec![Meta::Hidden]))
}
}
-
-impl Inline for HideNode {}