fix third core dump on export option

This commit is contained in:
2026-05-20 11:31:35 +02:00
parent 6f9d067e57
commit 14d3ac2128
2 changed files with 6 additions and 2 deletions
Binary file not shown.
+6 -2
View File
@@ -98,6 +98,7 @@ public static class StatsPanel
/// <summary> /// <summary>
/// Renders a horizontal block bar of the given width. /// Renders a horizontal block bar of the given width.
/// e.g. [████████░░░░] /// e.g. [████████░░░░]
/// Result is a markup string safe for embedding inside a larger Markup call.
/// </summary> /// </summary>
private static string BuildBar(double percent, int width, string color) private static string BuildBar(double percent, int width, string color)
{ {
@@ -105,8 +106,11 @@ public static class StatsPanel
filled = Math.Clamp(filled, 0, width); filled = Math.Clamp(filled, 0, width);
var empty = width - filled; var empty = width - filled;
var bar = new string('\u2588', filled) + new string('\u2591', empty); // \u2588 = █ \u2591 = ░
return $"[[{color}]{bar}[/]]"; // [[ and ]] are Spectre escape sequences for literal [ and ]
var filledStr = new string('\u2588', filled);
var emptyStr = new string('\u2591', empty);
return $"[[[{color}]{filledStr}[/][dim]{emptyStr}[/]]]";
} }
private static string CpuColor(double pct) => pct switch private static string CpuColor(double pct) => pct switch