From d4e622271a72ae7797f1b343a3e83ea158baf8bd Mon Sep 17 00:00:00 2001 From: AJ Isaacs Date: Mon, 2 Nov 2026 07:28:44 -0500 Subject: [PATCH] feat(ui): show each drawing's count on the current plate The drawing list only showed nest-wide totals, so seeing how many of a drawing a layout holds meant counting parts by eye. Prefix the nested line with the current plate's count, e.g. "[78] 144 of 1 nested". Co-Authored-By: Claude Opus 5.5 --- OpenNest/Controls/DrawingListBox.cs | 12 ++++++++++++ OpenNest/Forms/EditNestForm.cs | 3 +++ 2 files changed, 15 insertions(+) diff --git a/OpenNest/Controls/DrawingListBox.cs b/OpenNest/Controls/DrawingListBox.cs index bd613d7e..4835921c 100644 --- a/OpenNest/Controls/DrawingListBox.cs +++ b/OpenNest/Controls/DrawingListBox.cs @@ -1,5 +1,6 @@ using System; using System.Drawing; +using System.Linq; using System.Windows.Forms; using Size = System.Drawing.Size; @@ -108,6 +109,12 @@ namespace OpenNest.Controls public bool HideQuantity { get; set; } + /// + /// The plate shown beside the list; each drawing's count on it prefixes the nested + /// quantity. Null omits the count. + /// + public Plate Plate { get; set; } + protected override void OnDrawItem(DrawItemEventArgs e) { if (e.Index >= Items.Count || e.Index <= -1) @@ -198,6 +205,11 @@ namespace OpenNest.Controls dwg.Quantity.Nested, dwg.Quantity.Required ); + var onPlate = Plate?.Parts.Count(part => part.BaseDrawing == dwg) ?? 0; + + if (onPlate > 0) + text1 = $"[{onPlate}] {text1}"; + pt.Y += 22; e.Graphics.DrawString(text1, Font, detailBrush, pt); pt.Y += 18; diff --git a/OpenNest/Forms/EditNestForm.cs b/OpenNest/Forms/EditNestForm.cs index 908c4c0d..cff37f58 100644 --- a/OpenNest/Forms/EditNestForm.cs +++ b/OpenNest/Forms/EditNestForm.cs @@ -502,6 +502,7 @@ namespace OpenNest.Forms Text = Nest.Name; drawingListBox1.Units = Nest.Units; + drawingListBox1.Plate = PlateManager.CurrentPlate; } private void UnbindNest() @@ -1627,6 +1628,8 @@ namespace OpenNest.Forms { PlateView.Plate = PlateManager.CurrentPlate; PlateView.ZoomToFit(); + drawingListBox1.Plate = PlateManager.CurrentPlate; + drawingListBox1.Invalidate(); SelectCurrentPlateInList(); UpdatePlateHeader(); UpdateRemovePlateButton();