From f97530a6713fbb5171b0444ee6992efc2913479a Mon Sep 17 00:00:00 2001 From: crazypeace Date: Sun, 2 Jul 2023 12:15:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E7=AA=97=E5=8F=A3=E7=9A=84?= =?UTF-8?q?=E5=B0=BA=E5=AF=B8=E4=B8=8D=E5=A4=A7=E4=BA=8E=E5=B1=8F=E5=B9=95?= =?UTF-8?q?=E7=9A=84=E5=B0=BA=E5=AF=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- v2rayN/v2rayN/Views/AddServer2Window.xaml.cs | 11 +++++++++-- v2rayN/v2rayN/Views/AddServerWindow.xaml.cs | 11 +++++++++-- v2rayN/v2rayN/Views/DNSSettingWindow.xaml.cs | 11 +++++++++-- v2rayN/v2rayN/Views/GlobalHotkeySettingWindow.xaml.cs | 11 +++++++++-- v2rayN/v2rayN/Views/MainWindow.xaml.cs | 11 +++++++++-- v2rayN/v2rayN/Views/OptionSettingWindow.xaml.cs | 11 +++++++++-- v2rayN/v2rayN/Views/RoutingRuleDetailsWindow.xaml.cs | 11 +++++++++-- v2rayN/v2rayN/Views/RoutingRuleSettingWindow.xaml.cs | 11 +++++++++-- v2rayN/v2rayN/Views/RoutingSettingWindow.xaml.cs | 11 +++++++++-- v2rayN/v2rayN/Views/SubEditWindow.xaml.cs | 11 +++++++++-- v2rayN/v2rayN/Views/SubSettingWindow.xaml.cs | 11 +++++++++-- 11 files changed, 99 insertions(+), 22 deletions(-) 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;