summaryrefslogtreecommitdiff
path: root/src/library/structure
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-10-28 16:43:38 +0200
committerLaurenz <laurmaedje@gmail.com>2022-10-28 16:43:38 +0200
commit95e9134a3c7d7a14d8c8928413fdffc665671895 (patch)
tree822b5f6c2d23aba33cfe4d199405e493e37c3d70 /src/library/structure
parent66030ae5d73d85a0463562230b87f8ec7554c746 (diff)
Refactor `geom` module
Diffstat (limited to 'src/library/structure')
-rw-r--r--src/library/structure/list.rs8
-rw-r--r--src/library/structure/table.rs10
2 files changed, 9 insertions, 9 deletions
diff --git a/src/library/structure/list.rs b/src/library/structure/list.rs
index 9d78238d..4ccdbc54 100644
--- a/src/library/structure/list.rs
+++ b/src/library/structure/list.rs
@@ -29,10 +29,10 @@ impl<const L: ListKind> ListNode<L> {
pub const LABEL: Label = Label::Default;
/// The indentation of each item's label.
#[property(resolve)]
- pub const INDENT: RawLength = RawLength::zero();
+ pub const INDENT: Length = Length::zero();
/// The space between the label and the body of each item.
#[property(resolve)]
- pub const BODY_INDENT: RawLength = Em::new(match L {
+ pub const BODY_INDENT: Length = Em::new(match L {
LIST | ENUM => 0.5,
DESC | _ => 1.0,
})
@@ -159,13 +159,13 @@ impl<const L: ListKind> Show for ListNode<L> {
}
Ok(Content::block(GridNode {
- tracks: Spec::with_x(vec![
+ tracks: Axes::with_x(vec![
TrackSizing::Relative(indent.into()),
TrackSizing::Auto,
TrackSizing::Relative(body_indent.into()),
TrackSizing::Auto,
]),
- gutter: Spec::with_y(vec![TrackSizing::Relative(gutter.into())]),
+ gutter: Axes::with_y(vec![TrackSizing::Relative(gutter.into())]),
cells,
}))
}
diff --git a/src/library/structure/table.rs b/src/library/structure/table.rs
index 9f89cd2b..7994f196 100644
--- a/src/library/structure/table.rs
+++ b/src/library/structure/table.rs
@@ -5,9 +5,9 @@ use crate::library::prelude::*;
#[derive(Debug, Hash)]
pub struct TableNode {
/// Defines sizing for content rows and columns.
- pub tracks: Spec<Vec<TrackSizing>>,
+ pub tracks: Axes<Vec<TrackSizing>>,
/// Defines sizing of gutter rows and columns between content.
- pub gutter: Spec<Vec<TrackSizing>>,
+ pub gutter: Axes<Vec<TrackSizing>>,
/// The nodes to be arranged in the table.
pub cells: Vec<Content>,
}
@@ -21,7 +21,7 @@ impl TableNode {
#[property(resolve, fold)]
pub const STROKE: Option<RawStroke> = Some(RawStroke::default());
/// How much to pad the cells's content.
- pub const PADDING: Relative<RawLength> = Length::pt(5.0).into();
+ pub const PADDING: Rel<Length> = Abs::pt(5.0).into();
/// The spacing above the table.
#[property(resolve, shorthand(around))]
@@ -37,8 +37,8 @@ impl TableNode {
let column_gutter = args.named("column-gutter")?;
let row_gutter = args.named("row-gutter")?;
Ok(Content::show(Self {
- tracks: Spec::new(columns, rows),
- gutter: Spec::new(
+ tracks: Axes::new(columns, rows),
+ gutter: Axes::new(
column_gutter.unwrap_or_else(|| base_gutter.clone()),
row_gutter.unwrap_or(base_gutter),
),