设置窗口的尺寸不大于屏幕的尺寸

pull/4045/head
crazypeace 2023-07-02 12:15:51 +08:00
parent 0fe7d5e598
commit f97530a671
11 changed files with 99 additions and 22 deletions

View File

@ -12,8 +12,15 @@ namespace v2rayN.Views
{
InitializeComponent();
this.MaxWidth = SystemParameters.WorkArea.Width;
this.MaxHeight = SystemParameters.WorkArea.Height;
// 设置窗口的尺寸不大于屏幕的尺寸
if (this.Width > SystemParameters.WorkArea.Width)
{
this.Width = SystemParameters.WorkArea.Width;
}
if (this.Height > SystemParameters.WorkArea.Height)
{
this.Height = SystemParameters.WorkArea.Height;
}
this.Owner = Application.Current.MainWindow;
this.Loaded += Window_Loaded;

View File

@ -16,8 +16,15 @@ namespace v2rayN.Views
{
InitializeComponent();
this.MaxWidth = SystemParameters.WorkArea.Width;
this.MaxHeight = SystemParameters.WorkArea.Height;
// 设置窗口的尺寸不大于屏幕的尺寸
if (this.Width > SystemParameters.WorkArea.Width)
{
this.Width = SystemParameters.WorkArea.Width;
}
if (this.Height > SystemParameters.WorkArea.Height)
{
this.Height = SystemParameters.WorkArea.Height;
}
this.Owner = Application.Current.MainWindow;
this.Loaded += Window_Loaded;

View File

@ -15,8 +15,15 @@ namespace v2rayN.Views
{
InitializeComponent();
this.MaxWidth = SystemParameters.WorkArea.Width;
this.MaxHeight = SystemParameters.WorkArea.Height;
// 设置窗口的尺寸不大于屏幕的尺寸
if (this.Width > SystemParameters.WorkArea.Width)
{
this.Width = SystemParameters.WorkArea.Width;
}
if (this.Height > SystemParameters.WorkArea.Height)
{
this.Height = SystemParameters.WorkArea.Height;
}
this.Owner = Application.Current.MainWindow;
_config = LazyConfig.Instance.GetConfig();

View File

@ -17,8 +17,15 @@ namespace v2rayN.Views
{
InitializeComponent();
this.MaxWidth = SystemParameters.WorkArea.Width;
this.MaxHeight = SystemParameters.WorkArea.Height;
// 设置窗口的尺寸不大于屏幕的尺寸
if (this.Width > SystemParameters.WorkArea.Width)
{
this.Width = SystemParameters.WorkArea.Width;
}
if (this.Height > SystemParameters.WorkArea.Height)
{
this.Height = SystemParameters.WorkArea.Height;
}
this.Owner = Application.Current.MainWindow;
_config = LazyConfig.Instance.GetConfig();

View File

@ -26,8 +26,15 @@ namespace v2rayN.Views
{
InitializeComponent();
this.MaxWidth = SystemParameters.WorkArea.Width;
this.MaxHeight = SystemParameters.WorkArea.Height;
// 设置窗口的尺寸不大于屏幕的尺寸
if (this.Width > SystemParameters.WorkArea.Width)
{
this.Width = SystemParameters.WorkArea.Width;
}
if (this.Height > SystemParameters.WorkArea.Height)
{
this.Height = SystemParameters.WorkArea.Height;
}
_config = LazyConfig.Instance.GetConfig();

View File

@ -19,8 +19,15 @@ namespace v2rayN.Views
{
InitializeComponent();
this.MaxWidth = SystemParameters.WorkArea.Width;
this.MaxHeight = SystemParameters.WorkArea.Height;
// 设置窗口的尺寸不大于屏幕的尺寸
if (this.Width > SystemParameters.WorkArea.Width)
{
this.Width = SystemParameters.WorkArea.Width;
}
if (this.Height > SystemParameters.WorkArea.Height)
{
this.Height = SystemParameters.WorkArea.Height;
}
this.Owner = Application.Current.MainWindow;
_config = LazyConfig.Instance.GetConfig();

View File

@ -13,8 +13,15 @@ namespace v2rayN.Views
{
InitializeComponent();
this.MaxWidth = SystemParameters.WorkArea.Width;
this.MaxHeight = SystemParameters.WorkArea.Height;
// 设置窗口的尺寸不大于屏幕的尺寸
if (this.Width > SystemParameters.WorkArea.Width)
{
this.Width = SystemParameters.WorkArea.Width;
}
if (this.Height > SystemParameters.WorkArea.Height)
{
this.Height = SystemParameters.WorkArea.Height;
}
this.Owner = Application.Current.MainWindow;
this.Loaded += Window_Loaded;

View File

@ -14,8 +14,15 @@ namespace v2rayN.Views
{
InitializeComponent();
this.MaxWidth = SystemParameters.WorkArea.Width;
this.MaxHeight = SystemParameters.WorkArea.Height;
// 设置窗口的尺寸不大于屏幕的尺寸
if (this.Width > SystemParameters.WorkArea.Width)
{
this.Width = SystemParameters.WorkArea.Width;
}
if (this.Height > SystemParameters.WorkArea.Height)
{
this.Height = SystemParameters.WorkArea.Height;
}
this.Owner = Application.Current.MainWindow;
this.Loaded += Window_Loaded;

View File

@ -13,8 +13,15 @@ namespace v2rayN.Views
{
InitializeComponent();
this.MaxWidth = SystemParameters.WorkArea.Width;
this.MaxHeight = SystemParameters.WorkArea.Height;
// 设置窗口的尺寸不大于屏幕的尺寸
if (this.Width > SystemParameters.WorkArea.Width)
{
this.Width = SystemParameters.WorkArea.Width;
}
if (this.Height > SystemParameters.WorkArea.Height)
{
this.Height = SystemParameters.WorkArea.Height;
}
this.Owner = Application.Current.MainWindow;
this.Closing += RoutingSettingWindow_Closing;

View File

@ -12,8 +12,15 @@ namespace v2rayN.Views
{
InitializeComponent();
this.MaxWidth = SystemParameters.WorkArea.Width;
this.MaxHeight = SystemParameters.WorkArea.Height;
// 设置窗口的尺寸不大于屏幕的尺寸
if (this.Width > SystemParameters.WorkArea.Width)
{
this.Width = SystemParameters.WorkArea.Width;
}
if (this.Height > SystemParameters.WorkArea.Height)
{
this.Height = SystemParameters.WorkArea.Height;
}
this.Owner = Application.Current.MainWindow;
this.Loaded += Window_Loaded;

View File

@ -14,8 +14,15 @@ namespace v2rayN.Views
{
InitializeComponent();
this.MaxWidth = SystemParameters.WorkArea.Width;
this.MaxHeight = SystemParameters.WorkArea.Height;
// 设置窗口的尺寸不大于屏幕的尺寸
if (this.Width > SystemParameters.WorkArea.Width)
{
this.Width = SystemParameters.WorkArea.Width;
}
if (this.Height > SystemParameters.WorkArea.Height)
{
this.Height = SystemParameters.WorkArea.Height;
}
this.Owner = Application.Current.MainWindow;