From 582d3c1845e8d3c16dd1d248435fc42eb9f3d080 Mon Sep 17 00:00:00 2001 From: Joseph Finney Date: Sat, 17 Feb 2024 11:57:17 -0600 Subject: [PATCH 1/4] Add option to not restore window position, insread center on screen --- Text-Grab/App.config | 3 +++ Text-Grab/Properties/Settings.Designer.cs | 14 +++++++++++++- Text-Grab/Properties/Settings.settings | 3 +++ Text-Grab/Views/EditTextWindow.xaml | 11 +++++++++++ Text-Grab/Views/EditTextWindow.xaml.cs | 18 +++++++++++++++++- 5 files changed, 47 insertions(+), 2 deletions(-) diff --git a/Text-Grab/App.config b/Text-Grab/App.config index d2e5fee7..e0f4b365 100644 --- a/Text-Grab/App.config +++ b/Text-Grab/App.config @@ -133,6 +133,9 @@ + + True + \ No newline at end of file diff --git a/Text-Grab/Properties/Settings.Designer.cs b/Text-Grab/Properties/Settings.Designer.cs index 428275eb..61a3a685 100644 --- a/Text-Grab/Properties/Settings.Designer.cs +++ b/Text-Grab/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace Text_Grab.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.9.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.10.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); @@ -526,5 +526,17 @@ public string ShortcutKeySets { this["ShortcutKeySets"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool RestoreEtwPositions { + get { + return ((bool)(this["RestoreEtwPositions"])); + } + set { + this["RestoreEtwPositions"] = value; + } + } } } diff --git a/Text-Grab/Properties/Settings.settings b/Text-Grab/Properties/Settings.settings index 91fc54f3..fb1c46f2 100644 --- a/Text-Grab/Properties/Settings.settings +++ b/Text-Grab/Properties/Settings.settings @@ -128,5 +128,8 @@ + + True + \ No newline at end of file diff --git a/Text-Grab/Views/EditTextWindow.xaml b/Text-Grab/Views/EditTextWindow.xaml index be655aaa..2e96aa98 100644 --- a/Text-Grab/Views/EditTextWindow.xaml +++ b/Text-Grab/Views/EditTextWindow.xaml @@ -21,6 +21,7 @@ Loaded="Window_Loaded" PreviewKeyDown="EditTextWindow_PreviewKeyDown" ResizeMode="CanResizeWithGrip" + WindowStartupLocation="CenterScreen" mc:Ignorable="d">