feat(ui): remember status-bar location mode as a user setting

Clicking the location label now saves the mouse-follow/click-only choice
to StatusBarLocationFollowsMouse (default true), so it survives restarts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ajandClaude Opus 5.5 committed 2026-10-17 23:13:02 -04:00
1 parent 4176e9d89a
commit af65cb178b
3 files changed
+22 -2

No files matched your search

+6 -2
View File
@@ -4,13 +4,15 @@ using System.Linq;
using System.Windows.Forms;
using OpenNest.Collections;
using OpenNest.Geometry;
using OpenNest.Properties;
namespace OpenNest.Forms
{
/// <summary>
/// The main window's status labels for the active nest document: status text, cursor
/// location, selection bounds and plate index/size/quantity/utilization. The location
/// follows the mouse (the default, throttled), or only left clicks while click mode is on.
/// follows the mouse (the default, throttled), or only left clicks while click mode is on;
/// the mode persists as a user setting.
/// </summary>
internal sealed class MainStatusBar
{
@@ -27,7 +29,7 @@ namespace OpenNest.Forms
private readonly Timer locationTimer;
private EditNestForm form;
private bool clickUpdatesLocation;
private bool clickUpdatesLocation = !Settings.Default.StatusBarLocationFollowsMouse;
private bool locationPending;
public MainStatusBar(ToolStripStatusLabel status, ToolStripStatusLabel location,
@@ -93,6 +95,8 @@ namespace OpenNest.Forms
public void ToggleLocationMode()
{
clickUpdatesLocation = !clickUpdatesLocation;
Settings.Default.StatusBarLocationFollowsMouse = !clickUpdatesLocation;
Settings.Default.Save();
ApplyLocationMode();
}
+13
View File
@@ -283,5 +283,18 @@ namespace OpenNest.Properties {
this["DrawingLibraryCutType"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
// Status-bar location follows the mouse; false updates it only on left clicks.
public bool StatusBarLocationFollowsMouse {
get {
return ((bool)(this["StatusBarLocationFollowsMouse"]));
}
set {
this["StatusBarLocationFollowsMouse"] = value;
}
}
}
}
+3
View File
@@ -68,5 +68,8 @@
<Setting Name="DrawingLibraryCutType" Type="System.String" Scope="User">
<Value Profile="(Default)">Laser</Value>
</Setting>
<Setting Name="StatusBarLocationFollowsMouse" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
</Settings>
</SettingsFile>