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)
|
public void AddItem(FileListItem item)
|
||||||
{
|
{
|
||||||
items.Add(item);
|
items.Add(item);
|
||||||
if (items.Count == 1) selectedIndex = 0;
|
if (items.Count == 1)
|
||||||
|
{
|
||||||
|
selectedIndex = 0;
|
||||||
|
SelectedIndexChanged?.Invoke(this, selectedIndex);
|
||||||
|
}
|
||||||
Invalidate();
|
Invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -194,8 +194,10 @@ namespace OpenNest.Forms
|
|||||||
private void OnQuantityChanged(object sender, EventArgs e)
|
private void OnQuantityChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var item = CurrentItem;
|
var item = CurrentItem;
|
||||||
if (item != null)
|
if (item == null) return;
|
||||||
|
|
||||||
item.Quantity = (int)numQuantity.Value;
|
item.Quantity = (int)numQuantity.Value;
|
||||||
|
fileList.Invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnCustomerChanged(object sender, EventArgs e)
|
private void OnCustomerChanged(object sender, EventArgs e)
|
||||||
|
|||||||
Reference in New Issue
Block a user