From 83125ca4c07154ad2b1afebbaf64c81d3c27b5a4 Mon Sep 17 00:00:00 2001 From: AJ Isaacs Date: Fri, 27 Nov 2026 06:46:06 -0500 Subject: [PATCH] feat(desktop): show a plate's quantity large at the right of its card The quantity was tucked into the parts line, easy to miss when scanning the Plates list for layouts cut more than once. Co-Authored-By: Claude Opus 5.5 --- OpenNest/Controls/PlateListBox.cs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/OpenNest/Controls/PlateListBox.cs b/OpenNest/Controls/PlateListBox.cs index bf4ba8ce..755e6e64 100644 --- a/OpenNest/Controls/PlateListBox.cs +++ b/OpenNest/Controls/PlateListBox.cs @@ -24,6 +24,7 @@ namespace OpenNest.Controls private readonly Size imageSize; private readonly Font nameFont; + private readonly Font quantityFont; private readonly ToolTip toolTip = new ToolTip(); private readonly Dictionary previews = new Dictionary(); private int toolTipIndex = -1; @@ -38,6 +39,7 @@ namespace OpenNest.Controls imageSize = new Size(110, ItemHeight - 10); nameFont = new Font(Font.FontFamily, 10, FontStyle.Bold); + quantityFont = new Font(Font.FontFamily, 16, FontStyle.Bold); } /// The scheme the pictures take the sheet colors from. @@ -114,11 +116,10 @@ namespace OpenNest.Controls g.DrawString(isSentinel ? "New plate" : $"Plate {e.Index + 1}", nameFont, Brushes.Black, pt); var partCount = plate.Parts.Count(part => !part.BaseDrawing.IsCutOff); - var quantity = plate.Quantity > 1 ? $"×{plate.Quantity} " : ""; var lines = new List { plate.Size.ToString(4), - isSentinel ? "Empty" : $"{quantity}{partCount} {(partCount == 1 ? "part" : "parts")}", + isSentinel ? "Empty" : $"{partCount} {(partCount == 1 ? "part" : "parts")}", }; if (partCount > 0) lines.Add($"{plate.Utilization():P0} utilized"); @@ -129,6 +130,18 @@ namespace OpenNest.Controls g.DrawString(line, Font, Brushes.Gray, pt); } + // How many sheets are cut from this layout, large at the right edge of the row. + if (plate.Quantity > 1) + { + var quantityBounds = new RectangleF(e.Bounds.X, e.Bounds.Y, e.Bounds.Width - 12, e.Bounds.Height); + using var format = new StringFormat + { + Alignment = StringAlignment.Far, + LineAlignment = StringAlignment.Center, + }; + g.DrawString($"×{plate.Quantity}", quantityFont, Brushes.Gray, quantityBounds, format); + } + using var separatorPen = new Pen(Color.LightGray); var separatorY = e.Bounds.Bottom - 1; g.DrawLine(separatorPen, e.Bounds.X, separatorY, e.Bounds.Right, separatorY); @@ -365,6 +378,7 @@ namespace OpenNest.Controls previews.Clear(); toolTip.Dispose(); nameFont.Dispose(); + quantityFont.Dispose(); } base.Dispose(disposing);