|
1 | | -using System; |
| 1 | +using NETworkManager.Settings; |
| 2 | +using NETworkManager.Utilities; |
| 3 | +using NETworkManager.Views; |
| 4 | +using System; |
2 | 5 | using System.ComponentModel; |
3 | 6 | using System.Runtime.CompilerServices; |
4 | 7 | using System.Windows.Forms; |
5 | 8 | using System.Windows.Input; |
6 | 9 | using System.Windows.Threading; |
7 | | -using log4net; |
8 | | -using NETworkManager.Settings; |
9 | | -using NETworkManager.Utilities; |
10 | | -using NETworkManager.Views; |
11 | 10 |
|
12 | 11 | namespace NETworkManager; |
13 | 12 |
|
@@ -43,7 +42,7 @@ private void OnPropertyChanged([CallerMemberName] string propertyName = null) |
43 | 42 | #endregion |
44 | 43 |
|
45 | 44 | #region Variables |
46 | | - |
| 45 | + |
47 | 46 | // Set priority to make the ui smoother |
48 | 47 | private readonly DispatcherTimer _dispatcherTimerClose = new(DispatcherPriority.Normal); |
49 | 48 |
|
@@ -142,16 +141,18 @@ public void ShowWindow(bool enableCloseTimer = false) |
142 | 141 | // ToDo: User setting... |
143 | 142 | if (Screen.PrimaryScreen != null) |
144 | 143 | { |
145 | | - Left = Screen.PrimaryScreen.WorkingArea.Right - Width - 10; |
146 | | - Top = Screen.PrimaryScreen.WorkingArea.Bottom - Height - 10; |
| 144 | + var scaleFactor = System.Windows.Media.VisualTreeHelper.GetDpi(this).DpiScaleX; |
| 145 | + |
| 146 | + Left = Screen.PrimaryScreen.WorkingArea.Right / scaleFactor - Width - 10; |
| 147 | + Top = Screen.PrimaryScreen.WorkingArea.Bottom / scaleFactor - Height - 10; |
147 | 148 | } |
148 | 149 |
|
149 | 150 | // Show the window |
150 | 151 | Show(); |
151 | | - |
| 152 | + |
152 | 153 | // Check the network connection |
153 | 154 | Check(); |
154 | | - |
| 155 | + |
155 | 156 | // Close the window after a certain time |
156 | 157 | if (enableCloseTimer) |
157 | 158 | { |
|
0 commit comments