fix: auto-select first part and refresh quantity in CadConverter file list

Fire SelectedIndexChanged when the first item is added so the preview
loads automatically. Invalidate the file list after quantity changes so
the badge repaints immediately.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
ajandClaude Opus 4.6 committed 2026-03-24 23:01:51 -04:00
1 parent d5b5ab57e3
commit f626fbe063
2 files changed
+9 -3

No files matched your search

+5 -1
View File
@@ -63,7 +63,11 @@ namespace OpenNest.Controls
public void AddItem(FileListItem item)
{
items.Add(item);
if (items.Count == 1) selectedIndex = 0;
if (items.Count == 1)
{
selectedIndex = 0;
SelectedIndexChanged?.Invoke(this, selectedIndex);
}
Invalidate();
}
+4 -2
View File
@@ -194,8 +194,10 @@ namespace OpenNest.Forms
private void OnQuantityChanged(object sender, EventArgs e)
{
var item = CurrentItem;
if (item != null)
item.Quantity = (int)numQuantity.Value;
if (item == null) return;
item.Quantity = (int)numQuantity.Value;
fileList.Invalidate();
}
private void OnCustomerChanged(object sender, EventArgs e)