diff --git a/OpenNest/Forms/MainStatusBar.cs b/OpenNest/Forms/MainStatusBar.cs index c4c1fbd9..a0d95a87 100644 --- a/OpenNest/Forms/MainStatusBar.cs +++ b/OpenNest/Forms/MainStatusBar.cs @@ -4,13 +4,15 @@ using System.Linq; using System.Windows.Forms; using OpenNest.Collections; using OpenNest.Geometry; +using OpenNest.Properties; namespace OpenNest.Forms { /// /// 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. /// 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(); } diff --git a/OpenNest/Properties/Settings.Designer.cs b/OpenNest/Properties/Settings.Designer.cs index e52b8082..d64b84f4 100644 --- a/OpenNest/Properties/Settings.Designer.cs +++ b/OpenNest/Properties/Settings.Designer.cs @@ -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; + } + } } } diff --git a/OpenNest/Properties/Settings.settings b/OpenNest/Properties/Settings.settings index 8dff7e14..5537cc9b 100644 --- a/OpenNest/Properties/Settings.settings +++ b/OpenNest/Properties/Settings.settings @@ -68,5 +68,8 @@ Laser + + True +