RemoveSystem.Windows.Forms references

pull/3611/head
2dust 2023-04-04 15:59:08 +08:00
parent 12ebad436a
commit 65fda407dc
1 changed files with 9 additions and 13 deletions

View File

@ -15,7 +15,6 @@ using v2rayN.Mode;
using v2rayN.Resx;
using v2rayN.ViewModels;
using Point = System.Windows.Point;
using SystemInformation = System.Windows.Forms.SystemInformation;
namespace v2rayN.Views
{
@ -422,14 +421,11 @@ namespace v2rayN.Views
IntPtr hWnd = new WindowInteropHelper(this).EnsureHandle();
Graphics g = Graphics.FromHwnd(hWnd);
if (Width > SystemInformation.WorkingArea.Width * 96 / g.DpiX)
{
Width = SystemInformation.WorkingArea.Width * 96 / g.DpiX;
}
if (Height > SystemInformation.WorkingArea.Height * 96 / g.DpiY)
{
Height = SystemInformation.WorkingArea.Height * 96 / g.DpiY;
}
var dip = 96;
var maxWidth = SystemParameters.WorkArea.Width * dip / g.DpiX;
var maxHeight = SystemParameters.WorkArea.Height * dip / g.DpiY;
if (Width > maxWidth) Width = maxWidth;
if (Height > maxHeight) Height = maxHeight;
if (_config.uiItem.mainGirdHeight1 > 0 && _config.uiItem.mainGirdHeight2 > 0)
{
gridMain.RowDefinitions[0].Height = new GridLength(_config.uiItem.mainGirdHeight1, GridUnitType.Star);
@ -452,7 +448,7 @@ namespace v2rayN.Views
else
{
item2.Width = item.Width;
item2.DisplayIndex = i ;
item2.DisplayIndex = i;
}
}
}