fix: adjust arrow size and color, designer reformat

This commit is contained in:
2026-03-31 22:53:15 -04:00
parent e1bb723169
commit 904eeb38c2
2 changed files with 101 additions and 92 deletions
+69 -60
View File
@@ -15,28 +15,30 @@ namespace OpenNest.Controls
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
mainSplit = new System.Windows.Forms.SplitContainer();
contourList = new System.Windows.Forms.ListBox();
reverseButton = new System.Windows.Forms.Button();
contourPanel = new System.Windows.Forms.Panel();
contourList = new System.Windows.Forms.ListBox();
contourMenu = new System.Windows.Forms.ContextMenuStrip(components);
menuReverse = new System.Windows.Forms.ToolStripMenuItem();
reverseButton = new System.Windows.Forms.Button();
rightSplit = new System.Windows.Forms.SplitContainer();
preview = new OpenNest.Controls.EntityView();
preview = new EntityView();
editorPanel = new System.Windows.Forms.Panel();
gcodeEditor = new System.Windows.Forms.TextBox();
editorToolbar = new System.Windows.Forms.Panel();
applyButton = new System.Windows.Forms.Button();
lblGcode = new System.Windows.Forms.Label();
contourMenu = new System.Windows.Forms.ContextMenuStrip();
menuReverse = new System.Windows.Forms.ToolStripMenuItem();
((System.ComponentModel.ISupportInitialize)mainSplit).BeginInit();
mainSplit.Panel1.SuspendLayout();
mainSplit.Panel2.SuspendLayout();
mainSplit.SuspendLayout();
contourPanel.SuspendLayout();
contourMenu.SuspendLayout();
((System.ComponentModel.ISupportInitialize)rightSplit).BeginInit();
rightSplit.Panel1.SuspendLayout();
rightSplit.Panel2.SuspendLayout();
rightSplit.SuspendLayout();
contourPanel.SuspendLayout();
editorPanel.SuspendLayout();
editorToolbar.SuspendLayout();
SuspendLayout();
@@ -48,12 +50,12 @@ namespace OpenNest.Controls
mainSplit.Location = new System.Drawing.Point(0, 0);
mainSplit.Name = "mainSplit";
//
// mainSplit.Panel1 — contour list panel
// mainSplit.Panel1
//
mainSplit.Panel1.Controls.Add(contourPanel);
mainSplit.Panel1MinSize = 150;
//
// mainSplit.Panel2 — preview + editor
// mainSplit.Panel2
//
mainSplit.Panel2.Controls.Add(rightSplit);
mainSplit.Size = new System.Drawing.Size(800, 500);
@@ -75,6 +77,7 @@ namespace OpenNest.Controls
//
contourList.BackColor = System.Drawing.Color.White;
contourList.BorderStyle = System.Windows.Forms.BorderStyle.None;
contourList.ContextMenuStrip = contourMenu;
contourList.Dock = System.Windows.Forms.DockStyle.Fill;
contourList.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable;
contourList.Font = new System.Drawing.Font("Segoe UI", 9F);
@@ -84,7 +87,18 @@ namespace OpenNest.Controls
contourList.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended;
contourList.Size = new System.Drawing.Size(180, 462);
contourList.TabIndex = 0;
contourList.ContextMenuStrip = contourMenu;
//
// contourMenu
//
contourMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { menuReverse });
contourMenu.Name = "contourMenu";
contourMenu.Size = new System.Drawing.Size(166, 26);
//
// menuReverse
//
menuReverse.Name = "menuReverse";
menuReverse.Size = new System.Drawing.Size(165, 22);
menuReverse.Text = "Reverse Direction";
//
// reverseButton
//
@@ -95,7 +109,7 @@ namespace OpenNest.Controls
reverseButton.Name = "reverseButton";
reverseButton.Size = new System.Drawing.Size(180, 38);
reverseButton.TabIndex = 1;
reverseButton.Text = "\u21C5 Reverse Direction";
reverseButton.Text = " Reverse Direction";
//
// rightSplit
//
@@ -103,11 +117,11 @@ namespace OpenNest.Controls
rightSplit.Location = new System.Drawing.Point(0, 0);
rightSplit.Name = "rightSplit";
//
// rightSplit.Panel1 — preview
// rightSplit.Panel1
//
rightSplit.Panel1.Controls.Add(preview);
//
// rightSplit.Panel2 — gcode editor
// rightSplit.Panel2
//
rightSplit.Panel2.Controls.Add(editorPanel);
rightSplit.Size = new System.Drawing.Size(615, 500);
@@ -123,8 +137,14 @@ namespace OpenNest.Controls
preview.IsPickingBendLine = false;
preview.Location = new System.Drawing.Point(0, 0);
preview.Name = "preview";
preview.OriginalEntities = null;
preview.PaintOverlay = null;
preview.ShowEntityLabels = false;
preview.Size = new System.Drawing.Size(615, 300);
preview.SimplifierHighlight = null;
preview.SimplifierPreview = null;
preview.SimplifierToleranceLeft = null;
preview.SimplifierToleranceRight = null;
preview.Size = new System.Drawing.Size(350, 500);
preview.TabIndex = 0;
//
// editorPanel
@@ -134,45 +154,9 @@ namespace OpenNest.Controls
editorPanel.Dock = System.Windows.Forms.DockStyle.Fill;
editorPanel.Location = new System.Drawing.Point(0, 0);
editorPanel.Name = "editorPanel";
editorPanel.Size = new System.Drawing.Size(615, 195);
editorPanel.Size = new System.Drawing.Size(260, 500);
editorPanel.TabIndex = 0;
//
// editorToolbar
//
editorToolbar.BackColor = System.Drawing.Color.FromArgb(245, 245, 245);
editorToolbar.Controls.Add(applyButton);
editorToolbar.Controls.Add(lblGcode);
editorToolbar.Dock = System.Windows.Forms.DockStyle.Top;
editorToolbar.Location = new System.Drawing.Point(0, 0);
editorToolbar.Name = "editorToolbar";
editorToolbar.Padding = new System.Windows.Forms.Padding(6, 4, 6, 4);
editorToolbar.Size = new System.Drawing.Size(615, 30);
editorToolbar.TabIndex = 0;
//
// lblGcode
//
lblGcode.AutoSize = true;
lblGcode.Dock = System.Windows.Forms.DockStyle.Left;
lblGcode.Font = new System.Drawing.Font("Segoe UI", 9F);
lblGcode.ForeColor = System.Drawing.Color.Gray;
lblGcode.Location = new System.Drawing.Point(6, 4);
lblGcode.Name = "lblGcode";
lblGcode.Padding = new System.Windows.Forms.Padding(0, 3, 0, 0);
lblGcode.Size = new System.Drawing.Size(50, 18);
lblGcode.TabIndex = 0;
lblGcode.Text = "G-Code";
//
// applyButton
//
applyButton.Dock = System.Windows.Forms.DockStyle.Right;
applyButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
applyButton.Font = new System.Drawing.Font("Segoe UI", 9F);
applyButton.Location = new System.Drawing.Point(539, 4);
applyButton.Name = "applyButton";
applyButton.Size = new System.Drawing.Size(70, 22);
applyButton.TabIndex = 1;
applyButton.Text = "Apply";
//
// gcodeEditor
//
gcodeEditor.BackColor = System.Drawing.Color.FromArgb(30, 30, 45);
@@ -184,21 +168,45 @@ namespace OpenNest.Controls
gcodeEditor.Multiline = true;
gcodeEditor.Name = "gcodeEditor";
gcodeEditor.ScrollBars = System.Windows.Forms.ScrollBars.Both;
gcodeEditor.Size = new System.Drawing.Size(615, 165);
gcodeEditor.Size = new System.Drawing.Size(260, 470);
gcodeEditor.TabIndex = 1;
gcodeEditor.WordWrap = false;
//
// contourMenu
// editorToolbar
//
contourMenu.Items.Add(menuReverse);
contourMenu.Name = "contourMenu";
contourMenu.Size = new System.Drawing.Size(180, 26);
editorToolbar.BackColor = System.Drawing.Color.FromArgb(245, 245, 245);
editorToolbar.Controls.Add(applyButton);
editorToolbar.Controls.Add(lblGcode);
editorToolbar.Dock = System.Windows.Forms.DockStyle.Top;
editorToolbar.Location = new System.Drawing.Point(0, 0);
editorToolbar.Name = "editorToolbar";
editorToolbar.Padding = new System.Windows.Forms.Padding(6, 4, 6, 4);
editorToolbar.Size = new System.Drawing.Size(260, 30);
editorToolbar.TabIndex = 0;
//
// menuReverse
// applyButton
//
menuReverse.Name = "menuReverse";
menuReverse.Size = new System.Drawing.Size(179, 22);
menuReverse.Text = "Reverse Direction";
applyButton.Dock = System.Windows.Forms.DockStyle.Right;
applyButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
applyButton.Font = new System.Drawing.Font("Segoe UI", 9F);
applyButton.Location = new System.Drawing.Point(184, 4);
applyButton.Name = "applyButton";
applyButton.Size = new System.Drawing.Size(70, 22);
applyButton.TabIndex = 1;
applyButton.Text = "Apply";
//
// lblGcode
//
lblGcode.AutoSize = true;
lblGcode.Dock = System.Windows.Forms.DockStyle.Left;
lblGcode.Font = new System.Drawing.Font("Segoe UI", 9F);
lblGcode.ForeColor = System.Drawing.Color.Gray;
lblGcode.Location = new System.Drawing.Point(6, 4);
lblGcode.Name = "lblGcode";
lblGcode.Padding = new System.Windows.Forms.Padding(0, 3, 0, 0);
lblGcode.Size = new System.Drawing.Size(48, 18);
lblGcode.TabIndex = 0;
lblGcode.Text = "G-Code";
//
// ProgramEditorControl
//
@@ -210,11 +218,12 @@ namespace OpenNest.Controls
mainSplit.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)mainSplit).EndInit();
mainSplit.ResumeLayout(false);
contourPanel.ResumeLayout(false);
contourMenu.ResumeLayout(false);
rightSplit.Panel1.ResumeLayout(false);
rightSplit.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)rightSplit).EndInit();
rightSplit.ResumeLayout(false);
contourPanel.ResumeLayout(false);
editorPanel.ResumeLayout(false);
editorPanel.PerformLayout();
editorToolbar.ResumeLayout(false);
+2 -2
View File
@@ -263,9 +263,9 @@ namespace OpenNest.Controls
if (contours.Count == 0) return;
var spacing = preview.LengthGuiToWorld(60f);
var arrowSize = 5f;
var arrowSize = 8f;
using var pen = new Pen(Color.FromArgb(60, 60, 60), 1.5f);
using var pen = new Pen(Color.LightGray, 1.5f);
for (var i = 0; i < contours.Count; i++)
{