Skip to content

Commit da3df1d

Browse files
author
devpossible
committed
feat(proxmox-summary-panel): improve CPU and RAM usage bar layout
1 parent d57fea1 commit da3df1d

2 files changed

Lines changed: 13 additions & 8 deletions

File tree

Directory.Build.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
<RepositoryUrl>https://github.com/DevPossible/LCDPossible</RepositoryUrl>
1010
<RepositoryType>git</RepositoryType>
1111
<PackageLicenseExpression>MIT</PackageLicenseExpression>
12-
<PackageReadmeFile>README.md</PackageReadmeFile>
1312

1413
<!-- Redirect bin/obj to /.build/{ProjectName}/ folder -->
1514
<BaseOutputPath>$(MSBuildThisFileDirectory).build\$(MSBuildProjectName)\bin\</BaseOutputPath>

src/Plugins/LCDPossible.Plugins.Proxmox/Panels/ProxmoxSummaryPanel.cs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,19 @@ public override async Task<Image<Rgba32>> RenderFrameAsync(int width, int height
7272
// Resource usage bars
7373
var barY = boxY + boxHeight + 30;
7474
var barHeight = 20;
75-
var barWidth = width / 2 - 130; // Leave margins: 20 left + 80 label + 30 gap in middle
76-
77-
DrawText(ctx, "CPU:", 20, barY, LabelFont!, SecondaryTextColor, 80);
78-
DrawProgressBar(ctx, metrics.Summary.CpuUsagePercent, 100, barY, barWidth, barHeight);
79-
80-
DrawText(ctx, "RAM:", width / 2 + 20, barY, LabelFont!, SecondaryTextColor, 80);
81-
DrawProgressBar(ctx, metrics.Summary.MemoryUsagePercent, width / 2 + 100, barY, barWidth, barHeight);
75+
var labelWidth = 60;
76+
var margin = 20;
77+
var centerGap = 40;
78+
// Each bar: margin + label + bar + centerGap/2 = width/2
79+
// barWidth = width/2 - margin - labelWidth - centerGap/2
80+
var barWidth = width / 2 - margin - labelWidth - centerGap;
81+
82+
DrawText(ctx, "CPU:", margin, barY, LabelFont!, SecondaryTextColor, labelWidth);
83+
DrawProgressBar(ctx, metrics.Summary.CpuUsagePercent, margin + labelWidth, barY, barWidth, barHeight);
84+
85+
var rightStart = width / 2 + centerGap / 2;
86+
DrawText(ctx, "RAM:", rightStart, barY, LabelFont!, SecondaryTextColor, labelWidth);
87+
DrawProgressBar(ctx, metrics.Summary.MemoryUsagePercent, rightStart + labelWidth, barY, barWidth, barHeight);
8288

8389
// Recent alert (if any)
8490
if (metrics.Alerts.Count > 0)

0 commit comments

Comments
 (0)