mirror of
https://github.com/2dust/v2rayN.git
synced 2025-05-03 05:38:51 +00:00
RemoveSystem.Windows.Forms references
This commit is contained in:
parent
12ebad436a
commit
65fda407dc
1 changed files with 9 additions and 13 deletions
|
@ -15,7 +15,6 @@ using v2rayN.Mode;
|
||||||
using v2rayN.Resx;
|
using v2rayN.Resx;
|
||||||
using v2rayN.ViewModels;
|
using v2rayN.ViewModels;
|
||||||
using Point = System.Windows.Point;
|
using Point = System.Windows.Point;
|
||||||
using SystemInformation = System.Windows.Forms.SystemInformation;
|
|
||||||
|
|
||||||
namespace v2rayN.Views
|
namespace v2rayN.Views
|
||||||
{
|
{
|
||||||
|
@ -422,14 +421,11 @@ namespace v2rayN.Views
|
||||||
|
|
||||||
IntPtr hWnd = new WindowInteropHelper(this).EnsureHandle();
|
IntPtr hWnd = new WindowInteropHelper(this).EnsureHandle();
|
||||||
Graphics g = Graphics.FromHwnd(hWnd);
|
Graphics g = Graphics.FromHwnd(hWnd);
|
||||||
if (Width > SystemInformation.WorkingArea.Width * 96 / g.DpiX)
|
var dip = 96;
|
||||||
{
|
var maxWidth = SystemParameters.WorkArea.Width * dip / g.DpiX;
|
||||||
Width = SystemInformation.WorkingArea.Width * 96 / g.DpiX;
|
var maxHeight = SystemParameters.WorkArea.Height * dip / g.DpiY;
|
||||||
}
|
if (Width > maxWidth) Width = maxWidth;
|
||||||
if (Height > SystemInformation.WorkingArea.Height * 96 / g.DpiY)
|
if (Height > maxHeight) Height = maxHeight;
|
||||||
{
|
|
||||||
Height = SystemInformation.WorkingArea.Height * 96 / g.DpiY;
|
|
||||||
}
|
|
||||||
if (_config.uiItem.mainGirdHeight1 > 0 && _config.uiItem.mainGirdHeight2 > 0)
|
if (_config.uiItem.mainGirdHeight1 > 0 && _config.uiItem.mainGirdHeight2 > 0)
|
||||||
{
|
{
|
||||||
gridMain.RowDefinitions[0].Height = new GridLength(_config.uiItem.mainGirdHeight1, GridUnitType.Star);
|
gridMain.RowDefinitions[0].Height = new GridLength(_config.uiItem.mainGirdHeight1, GridUnitType.Star);
|
||||||
|
@ -452,7 +448,7 @@ namespace v2rayN.Views
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
item2.Width = item.Width;
|
item2.Width = item.Width;
|
||||||
item2.DisplayIndex = i ;
|
item2.DisplayIndex = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue