diff --git a/hanatui/publish/hanatui b/hanatui/publish/hanatui index 0b0accc..23a312d 100755 Binary files a/hanatui/publish/hanatui and b/hanatui/publish/hanatui differ diff --git a/hanatui/src/Tui/Components/StatsPanel.cs b/hanatui/src/Tui/Components/StatsPanel.cs index 31e0408..1defcef 100644 --- a/hanatui/src/Tui/Components/StatsPanel.cs +++ b/hanatui/src/Tui/Components/StatsPanel.cs @@ -99,32 +99,27 @@ public static class StatsPanel /// private static IRenderable BuildBarRow(string label, double pct, int barWidth) { - var filled = (int)Math.Round(pct / 100.0 * barWidth); - filled = Math.Clamp(filled, 0, barWidth); - var empty = barWidth - filled; + var filled = (int)Math.Round(pct / 100.0 * barWidth); + filled = Math.Clamp(filled, 0, barWidth); + var empty = barWidth - filled; - var filledColor = CpuColor(pct); - var filledStr = new string('\u2588', filled); - var emptyStr = new string('\u2591', empty); + var filledColor = CpuColor(pct); + var filledStr = new string('\u2588', filled); + var emptyStr = new string('\u2591', empty); - var row = new Grid(); - row.AddColumn(new GridColumn().NoWrap().Width(9)); // label - row.AddColumn(new GridColumn().NoWrap()); // bar chars - row.AddColumn(new GridColumn().NoWrap().Width(7)); // pct + var row = new Grid(); + var colorMarkup = filledColor.ToMarkup(); - row.AddRow( - new Text($" {label,-5}", new Style(Color.Grey, decoration: Decoration.Dim)), - // Bar: colored filled + dim empty, wrapped in plain Text objects side by side - new Columns( - new Text("[", new Style(Color.Grey)), - new Text(filledStr, new Style(filledColor)), - new Text(emptyStr, new Style(Color.Grey, decoration: Decoration.Dim)), - new Text("]", new Style(Color.Grey)) - ), - new Text($" {pct,5:F1}%", new Style(Color.White, decoration: Decoration.Bold)) - ); + // Construct a seamless markup string + var barMarkup = $"[grey][[[/][{colorMarkup}]{filledStr}[/][grey dim]{emptyStr}[/][grey]]][/]"; - return row; + row.AddRow( + new Text($" {label,-5}", new Style(Color.Grey, decoration: Decoration.Dim)), + new Markup(barMarkup), // Replace Columns with a single Markup object + new Text($" {pct,5:F1}%", new Style(Color.White, decoration: Decoration.Bold)) + ); + + return row; } private static Color CpuColor(double pct) => pct switch