diff --git a/v2rayN/v2rayN/Views/AddServer2Window.xaml.cs b/v2rayN/v2rayN/Views/AddServer2Window.xaml.cs index 71946c9d..4fd1be1a 100644 --- a/v2rayN/v2rayN/Views/AddServer2Window.xaml.cs +++ b/v2rayN/v2rayN/Views/AddServer2Window.xaml.cs @@ -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; diff --git a/v2rayN/v2rayN/Views/AddServerWindow.xaml.cs b/v2rayN/v2rayN/Views/AddServerWindow.xaml.cs index e91076df..4db3fa2c 100644 --- a/v2rayN/v2rayN/Views/AddServerWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/AddServerWindow.xaml.cs @@ -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; diff --git a/v2rayN/v2rayN/Views/DNSSettingWindow.xaml.cs b/v2rayN/v2rayN/Views/DNSSettingWindow.xaml.cs index f23e32cb..8b84f2a3 100644 --- a/v2rayN/v2rayN/Views/DNSSettingWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/DNSSettingWindow.xaml.cs @@ -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(); diff --git a/v2rayN/v2rayN/Views/GlobalHotkeySettingWindow.xaml.cs b/v2rayN/v2rayN/Views/GlobalHotkeySettingWindow.xaml.cs index f4c41538..5b357f69 100644 --- a/v2rayN/v2rayN/Views/GlobalHotkeySettingWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/GlobalHotkeySettingWindow.xaml.cs @@ -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(); diff --git a/v2rayN/v2rayN/Views/MainWindow.xaml.cs b/v2rayN/v2rayN/Views/MainWindow.xaml.cs index fad24fd2..9ff4bea0 100644 --- a/v2rayN/v2rayN/Views/MainWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/MainWindow.xaml.cs @@ -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(); diff --git a/v2rayN/v2rayN/Views/OptionSettingWindow.xaml.cs b/v2rayN/v2rayN/Views/OptionSettingWindow.xaml.cs index d29d06b7..80f86efe 100644 --- a/v2rayN/v2rayN/Views/OptionSettingWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/OptionSettingWindow.xaml.cs @@ -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(); diff --git a/v2rayN/v2rayN/Views/RoutingRuleDetailsWindow.xaml.cs b/v2rayN/v2rayN/Views/RoutingRuleDetailsWindow.xaml.cs index 400bf64c..bd383aeb 100644 --- a/v2rayN/v2rayN/Views/RoutingRuleDetailsWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/RoutingRuleDetailsWindow.xaml.cs @@ -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; diff --git a/v2rayN/v2rayN/Views/RoutingRuleSettingWindow.xaml.cs b/v2rayN/v2rayN/Views/RoutingRuleSettingWindow.xaml.cs index 5a0c8d88..a1fc44f6 100644 --- a/v2rayN/v2rayN/Views/RoutingRuleSettingWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/RoutingRuleSettingWindow.xaml.cs @@ -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; diff --git a/v2rayN/v2rayN/Views/RoutingSettingWindow.xaml.cs b/v2rayN/v2rayN/Views/RoutingSettingWindow.xaml.cs index 8d4d712c..e1509d98 100644 --- a/v2rayN/v2rayN/Views/RoutingSettingWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/RoutingSettingWindow.xaml.cs @@ -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; diff --git a/v2rayN/v2rayN/Views/SubEditWindow.xaml.cs b/v2rayN/v2rayN/Views/SubEditWindow.xaml.cs index 4021d176..521309d8 100644 --- a/v2rayN/v2rayN/Views/SubEditWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/SubEditWindow.xaml.cs @@ -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; diff --git a/v2rayN/v2rayN/Views/SubSettingWindow.xaml.cs b/v2rayN/v2rayN/Views/SubSettingWindow.xaml.cs index 57d4b86a..3ebf9e51 100644 --- a/v2rayN/v2rayN/Views/SubSettingWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/SubSettingWindow.xaml.cs @@ -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;