aboutsummaryrefslogtreecommitdiff
path: root/Sources/NorgUI/Views
diff options
context:
space:
mode:
authorRuben Beltran del Rio <jj@r.bdr.sh>2026-06-18 22:05:21 +0200
committerRuben Beltran del Rio <jj@r.bdr.sh>2026-06-18 22:06:01 +0200
commitcb91a73bfc845d74c3e4d1115bce5dfed10d456d (patch)
tree62d218c4ec13f742b5de10ff442f46d152716658 /Sources/NorgUI/Views
parent3c391974907820c6385e90025faeab0d9c60bd06 (diff)
Make spacings configurable1.1.0
Diffstat (limited to 'Sources/NorgUI/Views')
-rw-r--r--Sources/NorgUI/Views/Blocks/HeadingView.swift2
-rw-r--r--Sources/NorgUI/Views/FlatBlocksView.swift2
-rw-r--r--Sources/NorgUI/Views/TreeNodesView.swift4
-rw-r--r--Sources/NorgUI/Views/VerbatimBlock.swift4
4 files changed, 7 insertions, 5 deletions
diff --git a/Sources/NorgUI/Views/Blocks/HeadingView.swift b/Sources/NorgUI/Views/Blocks/HeadingView.swift
index 3b65134..800bc46 100644
--- a/Sources/NorgUI/Views/Blocks/HeadingView.swift
+++ b/Sources/NorgUI/Views/Blocks/HeadingView.swift
@@ -21,6 +21,6 @@ struct HeadingView: View {
.font(font)
}
}
- .padding(.top, 4)
+ .padding(.top, theme.headingTopPadding)
}
}
diff --git a/Sources/NorgUI/Views/FlatBlocksView.swift b/Sources/NorgUI/Views/FlatBlocksView.swift
index 185d08b..747edb6 100644
--- a/Sources/NorgUI/Views/FlatBlocksView.swift
+++ b/Sources/NorgUI/Views/FlatBlocksView.swift
@@ -10,7 +10,7 @@ struct FlatBlocksView: View {
var body: some View {
let ordinals = orderedOrdinals(blocks)
- VStack(alignment: .leading, spacing: 10) {
+ VStack(alignment: .leading, spacing: theme.blockSpacing) {
ForEach(Array(blocks.enumerated()), id: \.offset) { index, block in
row(block, ordinal: ordinals[index])
}
diff --git a/Sources/NorgUI/Views/TreeNodesView.swift b/Sources/NorgUI/Views/TreeNodesView.swift
index a509138..a6df972 100644
--- a/Sources/NorgUI/Views/TreeNodesView.swift
+++ b/Sources/NorgUI/Views/TreeNodesView.swift
@@ -5,9 +5,11 @@ struct TreeNodesView: View {
let nodes: [NorgNode]
let onSetStatus: (Int, TaskStatus) -> Void
+ @Environment(\.norgTheme) private var theme
+
var body: some View {
let siblingOrdinals = ordinals(forSiblings: nodes)
- VStack(alignment: .leading, spacing: 10) {
+ VStack(alignment: .leading, spacing: theme.blockSpacing) {
ForEach(Array(nodes.enumerated()), id: \.offset) { index, node in
NodeView(node: node, ordinal: siblingOrdinals[index], onSetStatus: onSetStatus)
.id(node.block.line)
diff --git a/Sources/NorgUI/Views/VerbatimBlock.swift b/Sources/NorgUI/Views/VerbatimBlock.swift
index 722c3f3..8f16ec0 100644
--- a/Sources/NorgUI/Views/VerbatimBlock.swift
+++ b/Sources/NorgUI/Views/VerbatimBlock.swift
@@ -7,7 +7,7 @@ struct VerbatimBlock: View {
let content: String
var body: some View {
- VStack(alignment: .leading, spacing: 4) {
+ VStack(alignment: .leading, spacing: theme.verbatimLeadingSpace) {
if let label, !label.isEmpty {
Text(label)
.font(.caption2)
@@ -17,7 +17,7 @@ struct VerbatimBlock: View {
.font(theme.codeFont)
.frame(maxWidth: .infinity, alignment: .leading)
}
- .padding(10)
+ .padding(theme.verbatimPadding)
.background(theme.codeBackground, in: RoundedRectangle(cornerRadius: 8))
}
}