feat: move add/remove plate buttons to plate tab, sync remove state
Removed add and remove plate buttons from the plate header panel. The plate tab toolbar now has add/remove buttons with the remove button state driven by PlateManager.CanRemoveCurrent. MainForm's Plate > Remove menu item also syncs on plate change. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -35,7 +35,6 @@ namespace OpenNest.Forms
|
||||
private Panel plateHeaderPanel;
|
||||
private Label plateInfoLabel;
|
||||
private Button btnFirstPlate;
|
||||
private Button btnRemovePlate;
|
||||
|
||||
private Button btnPreviousPlate;
|
||||
private Button btnNextPlate;
|
||||
@@ -127,18 +126,8 @@ namespace OpenNest.Forms
|
||||
|
||||
navPanel.Controls.AddRange(new Control[] { btnFirstPlate, btnPreviousPlate, btnNextPlate, btnLastPlate });
|
||||
|
||||
btnRemovePlate = CreateNavButton(Resources.remove);
|
||||
btnRemovePlate.Dock = DockStyle.Right;
|
||||
btnRemovePlate.Click += (s, e) => RemoveCurrentPlate();
|
||||
|
||||
var btnAddPlate = CreateNavButton(Resources.add);
|
||||
btnAddPlate.Dock = DockStyle.Right;
|
||||
btnAddPlate.Click += (s, e) => Nest.CreatePlate();
|
||||
|
||||
plateHeaderPanel.Controls.Add(navPanel);
|
||||
plateHeaderPanel.Controls.Add(plateInfoLabel);
|
||||
plateHeaderPanel.Controls.Add(btnRemovePlate);
|
||||
plateHeaderPanel.Controls.Add(btnAddPlate);
|
||||
|
||||
// Center the nav panel on resize
|
||||
CenterNavPanel(navPanel);
|
||||
@@ -905,7 +894,7 @@ namespace OpenNest.Forms
|
||||
|
||||
private void UpdateRemovePlateButton()
|
||||
{
|
||||
btnRemovePlate.Enabled = PlateManager.CanRemoveCurrent;
|
||||
toolStripLabel2.Enabled = PlateManager.CanRemoveCurrent;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user