diff options
Diffstat (limited to 'src/library')
| -rw-r--r-- | src/library/align.rs | 11 | ||||
| -rw-r--r-- | src/library/mod.rs | 7 | ||||
| -rw-r--r-- | src/library/styles.rs | 25 |
3 files changed, 22 insertions, 21 deletions
diff --git a/src/library/align.rs b/src/library/align.rs index 4b2ee8c3..b1e41abb 100644 --- a/src/library/align.rs +++ b/src/library/align.rs @@ -38,12 +38,13 @@ impl Function for AlignFunc { Ok(AlignFunc { alignment, body }) } - fn layout(&self, mut ctx: LayoutContext) -> LayoutResult<Option<Layout>> { + fn layout(&self, ctx: LayoutContext) -> LayoutResult<FuncCommands> { if let Some(body) = &self.body { - // Override the previous alignment and do the layouting. - ctx.space.alignment = self.alignment; - layout(body, ctx) - .map(|l| Some(Layout::Boxed(l))) + // // Override the previous alignment and do the layouting. + // ctx.space.alignment = self.alignment; + // layout(body, ctx) + // .map(|l| Some(Layout::Boxed(l))) + Ok(FuncCommands::new()) } else { unimplemented!("context-modifying align func") } diff --git a/src/library/mod.rs b/src/library/mod.rs index 9323c4c0..acbd11db 100644 --- a/src/library/mod.rs +++ b/src/library/mod.rs @@ -9,10 +9,9 @@ mod styles; pub mod prelude { pub use crate::syntax::{SyntaxTree, FuncHeader, Expression}; pub use crate::parsing::{parse, ParseContext, ParseResult, ParseError}; - pub use crate::layout::{layout, Layout, LayoutContext, LayoutResult, LayoutError}; - pub use crate::layout::flex::FlexLayout; - pub use crate::layout::boxed::BoxLayout; - pub use crate::func::Function; + pub use crate::layout::{layout_tree, layout_text, MultiLayout, Layout, LayoutContext}; + pub use crate::layout::{LayoutResult, LayoutError}; + pub use crate::func::{Function, Command, FuncCommands}; pub fn err<S: Into<String>, T>(message: S) -> ParseResult<T> { Err(ParseError::new(message)) diff --git a/src/library/styles.rs b/src/library/styles.rs index c84b9fed..28cc0e48 100644 --- a/src/library/styles.rs +++ b/src/library/styles.rs @@ -1,7 +1,7 @@ //! Basic style functions: bold, italic, monospace. use super::prelude::*; -use toddle::query::FontClass; +// use toddle::query::FontClass; @@ -27,19 +27,20 @@ macro_rules! style_func { } } - fn layout(&self, ctx: LayoutContext) -> LayoutResult<Option<Layout>> { - // Change the context. - let mut $style = ctx.style.clone(); - $style_change + fn layout(&self, ctx: LayoutContext) -> LayoutResult<FuncCommands> { + // // Change the context. + // let mut $style = ctx.style.clone(); + // $style_change - // Create a box and put it into a flex layout. - let boxed = layout(&self.body, LayoutContext { - style: &$style, - .. ctx - })?; - let flex = FlexLayout::from_box(boxed); + // // Create a box and put it into a flex layout. + // let boxed = layout(&self.body, LayoutContext { + // style: &$style, + // .. ctx + // })?; + // let flex = FlexLayout::from_box(boxed); - Ok(Some(Layout::Flex(flex))) + // Ok(Some(Layout::Flex(flex))) + Ok(FuncCommands::new()) } } }; |
