summaryrefslogtreecommitdiff
path: root/library/src/layout
diff options
context:
space:
mode:
Diffstat (limited to 'library/src/layout')
-rw-r--r--library/src/layout/spacing.rs6
-rw-r--r--library/src/layout/table.rs12
2 files changed, 17 insertions, 1 deletions
diff --git a/library/src/layout/spacing.rs b/library/src/layout/spacing.rs
index dbdf0c11..e67fec03 100644
--- a/library/src/layout/spacing.rs
+++ b/library/src/layout/spacing.rs
@@ -191,6 +191,12 @@ impl From<Em> for Spacing {
}
}
+impl From<Length> for Spacing {
+ fn from(length: Length) -> Self {
+ Self::Rel(length.into())
+ }
+}
+
impl From<Fr> for Spacing {
fn from(fr: Fr) -> Self {
Self::Fr(fr)
diff --git a/library/src/layout/table.rs b/library/src/layout/table.rs
index fabe8c33..012e63ac 100644
--- a/library/src/layout/table.rs
+++ b/library/src/layout/table.rs
@@ -1,4 +1,5 @@
use crate::layout::{AlignNode, GridLayouter, TrackSizings};
+use crate::meta::LocalName;
use crate::prelude::*;
/// A table of items.
@@ -31,7 +32,7 @@ use crate::prelude::*;
///
/// Display: Table
/// Category: layout
-#[node(Layout)]
+#[node(Layout, LocalName)]
pub struct TableNode {
/// Defines the column sizes. See the [grid documentation]($func/grid) for
/// more information on track sizing.
@@ -264,3 +265,12 @@ impl<T: Into<Value>> From<Celled<T>> for Value {
}
}
}
+
+impl LocalName for TableNode {
+ fn local_name(&self, lang: Lang) -> &'static str {
+ match lang {
+ Lang::GERMAN => "Tabelle",
+ Lang::ENGLISH | _ => "Table",
+ }
+ }
+}