From 67fd38ebd5b56198e652607ceb07abfb91780360 Mon Sep 17 00:00:00 2001 From: Labo Date: Sat, 5 May 2018 01:21:49 +0200 Subject: [PATCH] Change setting for windows position --- TraderForPoe/App.config | 9 +++-- TraderForPoe/MainWindow.xaml.cs | 7 ++-- TraderForPoe/Properties/Settings.Designer.cs | 36 +++++++++++++------- TraderForPoe/Properties/Settings.settings | 9 +++-- 4 files changed, 40 insertions(+), 21 deletions(-) diff --git a/TraderForPoe/App.config b/TraderForPoe/App.config index 586c6d0..71eec0d 100644 --- a/TraderForPoe/App.config +++ b/TraderForPoe/App.config @@ -22,9 +22,6 @@ - - 0, 0 - Give me one second! :) (Sent with TraderForPoe) @@ -58,6 +55,12 @@ True + + 0 + + + 0 + diff --git a/TraderForPoe/MainWindow.xaml.cs b/TraderForPoe/MainWindow.xaml.cs index b538556..bca3a58 100644 --- a/TraderForPoe/MainWindow.xaml.cs +++ b/TraderForPoe/MainWindow.xaml.cs @@ -181,9 +181,9 @@ private void LoadSetting() // Subscribe to SetNoActiveWindow. Prevent window from focus Loaded += (object sender, RoutedEventArgs e) => SetNoActiveWindow(); - this.Top = Settings.Default.WindowLocation.X; + this.Top = Settings.Default.PosTop; - this.Left = Settings.Default.WindowLocation.Y; + this.Left = Settings.Default.PosLeft; } private string GetClipboardText() @@ -490,7 +490,8 @@ private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs private void Window_LocationChanged(object sender, EventArgs e) { - Settings.Default.WindowLocation = new System.Drawing.Point((int)this.Left, (int)this.Top); + Settings.Default.PosLeft = this.Left; + Settings.Default.PosTop = this.Top; Settings.Default.Save(); } diff --git a/TraderForPoe/Properties/Settings.Designer.cs b/TraderForPoe/Properties/Settings.Designer.cs index b7314c9..e7d4741 100644 --- a/TraderForPoe/Properties/Settings.Designer.cs +++ b/TraderForPoe/Properties/Settings.Designer.cs @@ -73,18 +73,6 @@ public string PathToClientTxt { } } - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("0, 0")] - public global::System.Drawing.Point WindowLocation { - get { - return ((global::System.Drawing.Point)(this["WindowLocation"])); - } - set { - this["WindowLocation"] = value; - } - } - [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("Give me one second! :) (Sent with TraderForPoe)")] @@ -230,5 +218,29 @@ public bool UpgradeSettingsRequired { this["UpgradeSettingsRequired"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("0")] + public double PosTop { + get { + return ((double)(this["PosTop"])); + } + set { + this["PosTop"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("0")] + public double PosLeft { + get { + return ((double)(this["PosLeft"])); + } + set { + this["PosLeft"] = value; + } + } } } diff --git a/TraderForPoe/Properties/Settings.settings b/TraderForPoe/Properties/Settings.settings index bba8f4f..33d860f 100644 --- a/TraderForPoe/Properties/Settings.settings +++ b/TraderForPoe/Properties/Settings.settings @@ -14,9 +14,6 @@ - - 0, 0 - Give me one second! :) (Sent with TraderForPoe) @@ -55,5 +52,11 @@ True + + 0 + + + 0 + \ No newline at end of file