mirror of
https://github.com/unclshura/splitter.git
synced 2026-06-22 00:22:01 +00:00
Fixed Spectre UI
This commit is contained in:
parent
5955fb2d29
commit
ac58534438
@ -173,7 +173,7 @@ public sealed class SpectreConsoleLogger : ILogger, IDisposable
|
|||||||
|
|
||||||
var layout = new Layout("root")
|
var layout = new Layout("root")
|
||||||
.SplitRows(
|
.SplitRows(
|
||||||
new Layout("progress") { Size = Math.Max(3, numberOfProcessesSnapshot + 2) },
|
new Layout("progress") { Size = Math.Max(3, numberOfProcessesSnapshot + 4) },
|
||||||
new Layout("log")
|
new Layout("log")
|
||||||
//new Layout("buttons") { Size = 3 }
|
//new Layout("buttons") { Size = 3 }
|
||||||
);
|
);
|
||||||
@ -228,8 +228,8 @@ public sealed class SpectreConsoleLogger : ILogger, IDisposable
|
|||||||
foreach (var log in slice)
|
foreach (var log in slice)
|
||||||
{
|
{
|
||||||
var time = log.Timestamp.ToString("HH:mm:ss");
|
var time = log.Timestamp.ToString("HH:mm:ss");
|
||||||
var timeColor = "deepskyblue1"; // dark-ish blue
|
var timeColor = "deepskyblue1";
|
||||||
var prefixColor = "lightpink1"; // light magenta
|
var prefixColor = "lightpink1";
|
||||||
var msgColor = MapConsoleColor(log.Color);
|
var msgColor = MapConsoleColor(log.Color);
|
||||||
|
|
||||||
var line =
|
var line =
|
||||||
@ -240,38 +240,10 @@ public sealed class SpectreConsoleLogger : ILogger, IDisposable
|
|||||||
rows.Add(new Markup(line));
|
rows.Add(new Markup(line));
|
||||||
}
|
}
|
||||||
|
|
||||||
IRenderable content =
|
if (rows.Count == 0)
|
||||||
rows.Count == 0
|
return new Markup("[grey]No log messages yet.[/]");
|
||||||
? new Markup("[grey]No log messages yet.[/]")
|
|
||||||
: new Rows(rows);
|
|
||||||
|
|
||||||
var panel = new Panel(content)
|
return new Rows(rows);
|
||||||
{
|
|
||||||
Header = new PanelHeader("Log", Justify.Left),
|
|
||||||
Border = BoxBorder.Rounded,
|
|
||||||
Expand = true
|
|
||||||
};
|
|
||||||
|
|
||||||
return panel;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private static IRenderable BuildButtonsPanel()
|
|
||||||
{
|
|
||||||
// Visual [ Cancel ] button; key handling is in RunInputLoopAsync
|
|
||||||
var text = new Markup("[bold white on red] Cancel [/]");
|
|
||||||
var grid = new Grid();
|
|
||||||
grid.AddColumn(new GridColumn().Centered());
|
|
||||||
grid.AddRow(text);
|
|
||||||
|
|
||||||
var panel = new Panel(grid)
|
|
||||||
{
|
|
||||||
Border = BoxBorder.Rounded,
|
|
||||||
Header = new PanelHeader("Actions", Justify.Left),
|
|
||||||
Expand = true
|
|
||||||
};
|
|
||||||
|
|
||||||
return panel;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---- Helpers ----
|
// ---- Helpers ----
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user