diff --git a/src/KKManager.Core/Properties/Settings.Designer.cs b/src/KKManager.Core/Properties/Settings.Designer.cs index d1354c9..3d38384 100644 --- a/src/KKManager.Core/Properties/Settings.Designer.cs +++ b/src/KKManager.Core/Properties/Settings.Designer.cs @@ -76,5 +76,44 @@ public string Language { this["Language"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Configuration.SettingsProviderAttribute(typeof(PortableSettingsProvider.PortableSettingsProvider))] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("0, 0")] + public global::System.Drawing.Size WindowSize { + get { + return ((global::System.Drawing.Size)(this["WindowSize"])); + } + set { + this["WindowSize"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Configuration.SettingsProviderAttribute(typeof(PortableSettingsProvider.PortableSettingsProvider))] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("-1, -1")] + public global::System.Drawing.Point WindowLocation { + get { + return ((global::System.Drawing.Point)(this["WindowLocation"])); + } + set { + this["WindowLocation"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Configuration.SettingsProviderAttribute(typeof(PortableSettingsProvider.PortableSettingsProvider))] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool WindowMaximized { + get { + return ((bool)(this["WindowMaximized"])); + } + set { + this["WindowMaximized"] = value; + } + } } } diff --git a/src/KKManager.Core/Properties/Settings.settings b/src/KKManager.Core/Properties/Settings.settings index dae2b23..3446dd0 100644 --- a/src/KKManager.Core/Properties/Settings.settings +++ b/src/KKManager.Core/Properties/Settings.settings @@ -14,5 +14,14 @@ + + 0, 0 + + + -1, -1 + + + False + \ No newline at end of file diff --git a/src/KKManager.Core/app.config b/src/KKManager.Core/app.config index 946af21..b1fd2c6 100644 --- a/src/KKManager.Core/app.config +++ b/src/KKManager.Core/app.config @@ -1,5 +1,10 @@  + + +
+ + @@ -40,4 +45,29 @@ + + + + + + + + + + False + + + + + + 0, 0 + + + -1, -1 + + + False + + + \ No newline at end of file diff --git a/src/KKManager/Windows/MainWindow.cs b/src/KKManager/Windows/MainWindow.cs index c85eb62..ddedcbe 100644 --- a/src/KKManager/Windows/MainWindow.cs +++ b/src/KKManager/Windows/MainWindow.cs @@ -63,6 +63,14 @@ public MainWindow() Settings.Default.Binder.BindControl(checkForUpdatesOnStartupToolStripMenuItem, settings => settings.AutoUpdateSearch, this); Settings.Default.Binder.SendUpdates(this); + + if (Settings.Default.WindowLocation != new Point(-1, -1)) + { + StartPosition = FormStartPosition.Manual; + Location = Settings.Default.WindowLocation; + } + if (!Settings.Default.WindowSize.IsEmpty) Size = Settings.Default.WindowSize; + if (Settings.Default.WindowMaximized) WindowState = FormWindowState.Maximized; } private static DirectoryInfo GetGameDirectory() @@ -145,7 +153,7 @@ private static string ShowInstallDirectoryDialog(string currentPath) Title = "Select the install directory of your game" }) { - retryFolderSelect: + retryFolderSelect: if (fb.ShowDialog() == CommonFileDialogResult.Ok) { var path = fb.FileName; @@ -329,6 +337,11 @@ private void MainWindow_FormClosed(object sender, FormClosedEventArgs e) dockPanel.SaveAsXml(s, Encoding.Unicode); Settings.Default.DockState = Encoding.Unicode.GetString(s.ToArray()); } + + Settings.Default.WindowLocation = Location; + var maximized = WindowState == FormWindowState.Maximized; + Settings.Default.WindowMaximized = maximized; + if (!maximized) Settings.Default.WindowSize = Size; } private void openFemaleCardFolderToolStripMenuItem_Click(object sender, EventArgs e)