Skip to content

Commit

Permalink
Change setting for windows position
Browse files Browse the repository at this point in the history
  • Loading branch information
Labo committed May 4, 2018
1 parent cc4c902 commit 67fd38e
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 21 deletions.
9 changes: 6 additions & 3 deletions TraderForPoe/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
<setting name="PathToClientTxt" serializeAs="String">
<value />
</setting>
<setting name="WindowLocation" serializeAs="String">
<value>0, 0</value>
</setting>
<setting name="CustomWhisper1" serializeAs="String">
<value>Give me one second! :) (Sent with TraderForPoe)</value>
</setting>
Expand Down Expand Up @@ -58,6 +55,12 @@
<setting name="UpgradeSettingsRequired" serializeAs="String">
<value>True</value>
</setting>
<setting name="PosTop" serializeAs="String">
<value>0</value>
</setting>
<setting name="PosLeft" serializeAs="String">
<value>0</value>
</setting>
</TraderForPoe.Properties.Settings>
</userSettings>
</configuration>
7 changes: 4 additions & 3 deletions TraderForPoe/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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();
}

Expand Down
36 changes: 24 additions & 12 deletions TraderForPoe/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions TraderForPoe/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
<Setting Name="PathToClientTxt" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="WindowLocation" Type="System.Drawing.Point" Scope="User">
<Value Profile="(Default)">0, 0</Value>
</Setting>
<Setting Name="CustomWhisper1" Type="System.String" Scope="User">
<Value Profile="(Default)">Give me one second! :) (Sent with TraderForPoe)</Value>
</Setting>
Expand Down Expand Up @@ -55,5 +52,11 @@
<Setting Name="UpgradeSettingsRequired" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="PosTop" Type="System.Double" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="PosLeft" Type="System.Double" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
</Settings>
</SettingsFile>

0 comments on commit 67fd38e

Please sign in to comment.