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:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user