mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-22 04:17:40 -05:00
feat(nesting): turn the status bar green when the search ends
A finished search waiting for a layout pick looked the same as one still running, so it sat unnoticed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8638843437
commit
0cf9f9d0bd
2 files changed
+12
-1
No files matched your search
@@ -188,6 +188,8 @@ public class NestProgressFormLayoutsTests
|
||||
|
||||
Assert.False(pick.IsCompleted);
|
||||
Assert.Equal("Search finished. Pick the layout to use.", Status(form).Text);
|
||||
Assert.Equal(NestProgressForm.FinishedBackColor, Status(form).Parent!.BackColor);
|
||||
Assert.Equal(NestProgressForm.FinishedForeColor, Status(form).ForeColor);
|
||||
Button(form, "useLayoutButton").PerformClick();
|
||||
Assert.True(pick.Result);
|
||||
Assert.Same(row, form.ChosenLayout);
|
||||
|
||||
@@ -111,6 +111,12 @@ namespace OpenNest.Forms
|
||||
private Controls.LayoutChoiceList layoutList;
|
||||
private NestLayoutChoices layouts;
|
||||
private Button useLayoutButton;
|
||||
private TableLayoutPanel footer;
|
||||
|
||||
// The footer turns green once the search finishes, so a finished nest waiting for a
|
||||
// pick does not look like one still running.
|
||||
internal static readonly Color FinishedBackColor = Color.FromArgb(220, 242, 214);
|
||||
internal static readonly Color FinishedForeColor = Color.FromArgb(30, 100, 40);
|
||||
private Action stopSearch;
|
||||
private TaskCompletionSource<bool> choice;
|
||||
|
||||
@@ -150,7 +156,7 @@ namespace OpenNest.Forms
|
||||
};
|
||||
|
||||
// Status and buttons share one line: the detail text gets the whole width.
|
||||
var footer = new TableLayoutPanel
|
||||
footer = new TableLayoutPanel
|
||||
{
|
||||
Dock = DockStyle.Bottom,
|
||||
AutoSize = true,
|
||||
@@ -255,6 +261,9 @@ namespace OpenNest.Forms
|
||||
Text = "Nesting Finished";
|
||||
layoutList.BestLabel = "Best";
|
||||
descriptionValue.Text = "Search finished. Pick the layout to use.";
|
||||
footer.BackColor = FinishedBackColor;
|
||||
descriptionValue.ForeColor = FinishedForeColor;
|
||||
descriptionValue.Font = new Font(descriptionValue.Font, FontStyle.Bold);
|
||||
stopButton.Text = "Discard";
|
||||
stopButton.Enabled = true;
|
||||
UpdateUseLayout();
|
||||
|
||||
Reference in new issue
Block a user