Adam Brown
12/02/2024, 8:45 AMval progressLayout = progressBarLayout {
spinner(Spinner.Dots())
marquee(terminal.theme.warning("Running conversion"), width = 24, align = TextAlign.CENTER)
percentage()
progressBar()
completed(style = terminal.theme.success)
}
val progress = progressLayout.animateInCoroutine(t)
t.println(
Panel(
expand = true,
content = horizontalLayout {
column(0) { width = Expand(1) }
column(1) {
width = Auto
}
column(2) { width = Expand(1) }
cell(EmptyWidget)
cell(
table {
captionTop("Input Dictionary")
body {
row("Input File", path.name)
row("Size", inputMetadata.size.toString() + " Bytes")
row("Entries", numEntries)
row {
cell(
progressLayout.build(null, 0, TimeSource.Monotonic.markNow())
) {
columnSpan = 2
}
}
}
}
)
cell(EmptyWidget)
},
title = Text("FDIC Converter")
)
)
val scope = CoroutineScope(Dispatchers.Default)
scope.launch { progress.execute() }