From 527362dc9fb34b27c27575af15ab1d80df03aa86 Mon Sep 17 00:00:00 2001 From: crazypeace Date: Fri, 30 Jun 2023 13:29:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E7=AA=97=E5=8F=A3?= =?UTF-8?q?=E5=AE=BD=E5=92=8C=E9=AB=98=E7=9A=84=E6=9C=80=E5=A4=A7=E5=80=BC?= =?UTF-8?q?,=20=E4=BE=9D=E6=8D=AE=E5=B7=A5=E4=BD=9C=E5=8C=BA=E7=9A=84?= =?UTF-8?q?=E5=AE=BD=E5=92=8C=E9=AB=98.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 解决在笔记本屏幕上因为DPI较高导致窗口显示不全的问题. --- v2rayN/v2rayN/Views/AddServer2Window.xaml.cs | 4 ++++ v2rayN/v2rayN/Views/AddServerWindow.xaml.cs | 5 +++++ v2rayN/v2rayN/Views/DNSSettingWindow.xaml.cs | 4 ++++ v2rayN/v2rayN/Views/GlobalHotkeySettingWindow.xaml.cs | 4 ++++ v2rayN/v2rayN/Views/MainWindow.xaml | 2 -- v2rayN/v2rayN/Views/MainWindow.xaml.cs | 4 ++++ v2rayN/v2rayN/Views/OptionSettingWindow.xaml.cs | 4 ++++ v2rayN/v2rayN/Views/RoutingRuleDetailsWindow.xaml.cs | 4 ++++ v2rayN/v2rayN/Views/RoutingRuleSettingWindow.xaml.cs | 4 ++++ v2rayN/v2rayN/Views/RoutingSettingWindow.xaml.cs | 4 ++++ v2rayN/v2rayN/Views/SubEditWindow.xaml.cs | 4 ++++ v2rayN/v2rayN/Views/SubSettingWindow.xaml.cs | 4 ++++ 12 files changed, 45 insertions(+), 2 deletions(-) diff --git a/v2rayN/v2rayN/Views/AddServer2Window.xaml.cs b/v2rayN/v2rayN/Views/AddServer2Window.xaml.cs index 5fd56159..71946c9d 100644 --- a/v2rayN/v2rayN/Views/AddServer2Window.xaml.cs +++ b/v2rayN/v2rayN/Views/AddServer2Window.xaml.cs @@ -11,6 +11,10 @@ namespace v2rayN.Views public AddServer2Window(ProfileItem profileItem) { InitializeComponent(); + + this.MaxWidth = SystemParameters.WorkArea.Width; + this.MaxHeight = SystemParameters.WorkArea.Height; + this.Owner = Application.Current.MainWindow; this.Loaded += Window_Loaded; ViewModel = new AddServer2ViewModel(profileItem, this); diff --git a/v2rayN/v2rayN/Views/AddServerWindow.xaml.cs b/v2rayN/v2rayN/Views/AddServerWindow.xaml.cs index f16310e2..e75b304d 100644 --- a/v2rayN/v2rayN/Views/AddServerWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/AddServerWindow.xaml.cs @@ -1,4 +1,5 @@ using ReactiveUI; +using System.Net.Security; using System.Reactive.Disposables; using System.Windows; using System.Windows.Controls; @@ -15,6 +16,10 @@ namespace v2rayN.Views public AddServerWindow(ProfileItem profileItem) { InitializeComponent(); + + this.MaxWidth = SystemParameters.WorkArea.Width; + this.MaxHeight = SystemParameters.WorkArea.Height; + this.Owner = Application.Current.MainWindow; this.Loaded += Window_Loaded; cmbNetwork.SelectionChanged += CmbNetwork_SelectionChanged; diff --git a/v2rayN/v2rayN/Views/DNSSettingWindow.xaml.cs b/v2rayN/v2rayN/Views/DNSSettingWindow.xaml.cs index d95bc136..f23e32cb 100644 --- a/v2rayN/v2rayN/Views/DNSSettingWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/DNSSettingWindow.xaml.cs @@ -14,6 +14,10 @@ namespace v2rayN.Views public DNSSettingWindow() { InitializeComponent(); + + this.MaxWidth = SystemParameters.WorkArea.Width; + this.MaxHeight = 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 15221b1d..f4c41538 100644 --- a/v2rayN/v2rayN/Views/GlobalHotkeySettingWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/GlobalHotkeySettingWindow.xaml.cs @@ -16,6 +16,10 @@ namespace v2rayN.Views public GlobalHotkeySettingWindow() { InitializeComponent(); + + this.MaxWidth = SystemParameters.WorkArea.Width; + this.MaxHeight = SystemParameters.WorkArea.Height; + this.Owner = Application.Current.MainWindow; _config = LazyConfig.Instance.GetConfig(); _config.globalHotkeys ??= new List(); diff --git a/v2rayN/v2rayN/Views/MainWindow.xaml b/v2rayN/v2rayN/Views/MainWindow.xaml index ba961f66..1e731078 100644 --- a/v2rayN/v2rayN/Views/MainWindow.xaml +++ b/v2rayN/v2rayN/Views/MainWindow.xaml @@ -15,8 +15,6 @@ Title="v2rayN" Width="900" Height="700" - MinWidth="900" - MinHeight="700" x:TypeArguments="vms:MainWindowViewModel" Background="{DynamicResource MaterialDesignPaper}" FontFamily="{x:Static conv:MaterialDesignFonts.MyFont}" diff --git a/v2rayN/v2rayN/Views/MainWindow.xaml.cs b/v2rayN/v2rayN/Views/MainWindow.xaml.cs index d98ab2d5..fad24fd2 100644 --- a/v2rayN/v2rayN/Views/MainWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/MainWindow.xaml.cs @@ -25,6 +25,10 @@ namespace v2rayN.Views public MainWindow() { InitializeComponent(); + + this.MaxWidth = SystemParameters.WorkArea.Width; + this.MaxHeight = SystemParameters.WorkArea.Height; + _config = LazyConfig.Instance.GetConfig(); App.Current.SessionEnding += Current_SessionEnding; diff --git a/v2rayN/v2rayN/Views/OptionSettingWindow.xaml.cs b/v2rayN/v2rayN/Views/OptionSettingWindow.xaml.cs index 7d44263e..d29d06b7 100644 --- a/v2rayN/v2rayN/Views/OptionSettingWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/OptionSettingWindow.xaml.cs @@ -18,6 +18,10 @@ namespace v2rayN.Views public OptionSettingWindow() { InitializeComponent(); + + this.MaxWidth = SystemParameters.WorkArea.Width; + this.MaxHeight = 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 45d16c69..400bf64c 100644 --- a/v2rayN/v2rayN/Views/RoutingRuleDetailsWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/RoutingRuleDetailsWindow.xaml.cs @@ -12,6 +12,10 @@ namespace v2rayN.Views public RoutingRuleDetailsWindow(RulesItem rulesItem) { InitializeComponent(); + + this.MaxWidth = SystemParameters.WorkArea.Width; + this.MaxHeight = SystemParameters.WorkArea.Height; + this.Owner = Application.Current.MainWindow; this.Loaded += Window_Loaded; clbProtocol.SelectionChanged += ClbProtocol_SelectionChanged; diff --git a/v2rayN/v2rayN/Views/RoutingRuleSettingWindow.xaml.cs b/v2rayN/v2rayN/Views/RoutingRuleSettingWindow.xaml.cs index cfdb4432..5a0c8d88 100644 --- a/v2rayN/v2rayN/Views/RoutingRuleSettingWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/RoutingRuleSettingWindow.xaml.cs @@ -13,6 +13,10 @@ namespace v2rayN.Views public RoutingRuleSettingWindow(RoutingItem routingItem) { InitializeComponent(); + + this.MaxWidth = SystemParameters.WorkArea.Width; + this.MaxHeight = SystemParameters.WorkArea.Height; + this.Owner = Application.Current.MainWindow; this.Loaded += Window_Loaded; this.PreviewKeyDown += RoutingRuleSettingWindow_PreviewKeyDown; diff --git a/v2rayN/v2rayN/Views/RoutingSettingWindow.xaml.cs b/v2rayN/v2rayN/Views/RoutingSettingWindow.xaml.cs index 0f001dc9..8d4d712c 100644 --- a/v2rayN/v2rayN/Views/RoutingSettingWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/RoutingSettingWindow.xaml.cs @@ -12,6 +12,10 @@ namespace v2rayN.Views public RoutingSettingWindow() { InitializeComponent(); + + this.MaxWidth = SystemParameters.WorkArea.Width; + this.MaxHeight = SystemParameters.WorkArea.Height; + this.Owner = Application.Current.MainWindow; this.Closing += RoutingSettingWindow_Closing; this.PreviewKeyDown += RoutingSettingWindow_PreviewKeyDown; diff --git a/v2rayN/v2rayN/Views/SubEditWindow.xaml.cs b/v2rayN/v2rayN/Views/SubEditWindow.xaml.cs index 00187ce1..4021d176 100644 --- a/v2rayN/v2rayN/Views/SubEditWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/SubEditWindow.xaml.cs @@ -11,6 +11,10 @@ namespace v2rayN.Views public SubEditWindow(SubItem subItem) { InitializeComponent(); + + this.MaxWidth = SystemParameters.WorkArea.Width; + this.MaxHeight = 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 7f4eee58..57d4b86a 100644 --- a/v2rayN/v2rayN/Views/SubSettingWindow.xaml.cs +++ b/v2rayN/v2rayN/Views/SubSettingWindow.xaml.cs @@ -13,6 +13,10 @@ namespace v2rayN.Views public SubSettingWindow() { InitializeComponent(); + + this.MaxWidth = SystemParameters.WorkArea.Width; + this.MaxHeight = SystemParameters.WorkArea.Height; + this.Owner = Application.Current.MainWindow; ViewModel = new SubSettingViewModel(this);