Skip to content
This repository was archived by the owner on Nov 10, 2024. It is now read-only.

Commit a72cbf4

Browse files
authored
Merge pull request #72 from ckipp01/config
feat: add config file location to info as well
2 parents 24a96bf + f3a8902 commit a72cbf4

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

skan/src/Config.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ object Config:
2424
private val projectDirs = ProjectDirectories.from("io", "kipp", "skan")
2525
private lazy val dataDir = projectDirs.dataDir
2626
private val configDir = projectDirs.configDir
27-
private val configFile = os.Path(configDir) / "config.json"
2827
private lazy val defaultDataDir = os.Path(dataDir) / "contexts"
28+
val configFile = os.Path(configDir) / "config.json"
2929

3030
private def fromJson(json: String) =
3131
upickle.default.read[Config](json)

skan/src/ui/Info.scala

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ object Info:
1717
Constraint.Length(3),
1818
Constraint.Length(3),
1919
Constraint.Length(3),
20+
Constraint.Length(3),
2021
Constraint.Length(3)
2122
)
2223
).split(frame.size)
@@ -36,6 +37,19 @@ object Info:
3637
chunks(1)
3738
)
3839

40+
frame.renderWidget(
41+
ParagraphWidget(
42+
text = Text.nostyle(Config.configFile.toString),
43+
block = Some(
44+
BlockWidget(
45+
borders = Borders.ALL,
46+
title = Some(Spans.nostyle("Config File"))
47+
)
48+
)
49+
),
50+
chunks(2)
51+
)
52+
3953
frame.renderWidget(
4054
ParagraphWidget(
4155
text = Text.nostyle(config.zoneId.toString),
@@ -46,7 +60,7 @@ object Info:
4660
)
4761
)
4862
),
49-
chunks(2)
63+
chunks(3)
5064
)
5165

5266
frame.renderWidget(
@@ -59,7 +73,7 @@ object Info:
5973
)
6074
)
6175
),
62-
chunks(3)
76+
chunks(4)
6377
)
6478

6579
val helpText = Text.from(
@@ -69,6 +83,6 @@ object Info:
6983
val helpWidget =
7084
ParagraphWidget(text = helpText, wrap = Some(Wrap(trim = true)))
7185

72-
frame.renderWidget(helpWidget, chunks(4))
86+
frame.renderWidget(helpWidget, chunks(5))
7387
end render
7488
end Info

0 commit comments

Comments
 (0)