From 9eaf8b939c5b34be011921a81c2243fbc0f0659c Mon Sep 17 00:00:00 2001 From: Waheal <2035582067@qq.com> Date: Sun, 5 Oct 2025 21:40:05 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=B8=BAAvalonia=E7=89=88=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E9=9D=99=E9=BB=98=E5=90=AF=E5=8A=A8=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=EF=BC=8C=E9=98=B2=E6=AD=A2=E9=97=AA=E5=B1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- v2rayN/ServiceLib/Models/ConfigItems.cs | 1 + v2rayN/ServiceLib/Resx/ResUI.Designer.cs | 9 +++ v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx | 57 ++++++------- v2rayN/ServiceLib/Resx/ResUI.hu.resx | 57 ++++++------- v2rayN/ServiceLib/Resx/ResUI.resx | 57 ++++++------- v2rayN/ServiceLib/Resx/ResUI.ru.resx | 57 ++++++------- v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx | 60 +++++++------- v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx | 60 +++++++------- .../ViewModels/MainWindowViewModel.cs | 2 +- .../ViewModels/OptionSettingViewModel.cs | 3 + .../v2rayN.Desktop/Views/MainWindow.axaml.cs | 9 +++ .../Views/OptionSettingWindow.axaml | 79 +++++++++++-------- .../Views/OptionSettingWindow.axaml.cs | 1 + 13 files changed, 256 insertions(+), 196 deletions(-) diff --git a/v2rayN/ServiceLib/Models/ConfigItems.cs b/v2rayN/ServiceLib/Models/ConfigItems.cs index b9b305bb..c7ccf2e6 100644 --- a/v2rayN/ServiceLib/Models/ConfigItems.cs +++ b/v2rayN/ServiceLib/Models/ConfigItems.cs @@ -100,6 +100,7 @@ public class UIItem public bool EnableDragDropSort { get; set; } public bool DoubleClick2Activate { get; set; } public bool AutoHideStartup { get; set; } + public bool SilentStartup { get; set; } public bool Hide2TrayWhenClose { get; set; } public bool ShowInTaskbar { get; set; } public bool MacOSShowInDock { get; set; } diff --git a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs index 088f9b96..16fc1e97 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs +++ b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs @@ -3750,6 +3750,15 @@ namespace ServiceLib.Resx { } } + /// + /// 查找类似 Silent Startup 的本地化字符串。 + /// + public static string TbSettingsSilentStartup { + get { + return ResourceManager.GetString("TbSettingsSilentStartup", resourceCulture); + } + } + /// /// 查找类似 Turn on Sniffing 的本地化字符串。 /// diff --git a/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx b/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx index 280231d8..d1537bc0 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx @@ -1,17 +1,17 @@ - @@ -1560,4 +1560,7 @@ Multi-Configuration Fallback by Xray + + آغاز سکوت + \ No newline at end of file diff --git a/v2rayN/ServiceLib/Resx/ResUI.hu.resx b/v2rayN/ServiceLib/Resx/ResUI.hu.resx index 09796e2d..e2d29075 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.hu.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.hu.resx @@ -1,17 +1,17 @@ - @@ -1560,4 +1560,7 @@ Multi-Configuration Fallback by Xray + + Némán indítás + \ No newline at end of file diff --git a/v2rayN/ServiceLib/Resx/ResUI.resx b/v2rayN/ServiceLib/Resx/ResUI.resx index bf9f40a5..14fd8dbf 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.resx @@ -1,17 +1,17 @@ - @@ -1560,4 +1560,7 @@ Multi-Configuration Fallback by Xray + + Silent Startup + \ No newline at end of file diff --git a/v2rayN/ServiceLib/Resx/ResUI.ru.resx b/v2rayN/ServiceLib/Resx/ResUI.ru.resx index cde36277..41cfbb40 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.ru.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.ru.resx @@ -1,17 +1,17 @@ - @@ -1560,4 +1560,7 @@ Multi-Configuration Fallback by Xray + + Тихий запуск + \ No newline at end of file diff --git a/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx b/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx index 1506de01..ca806287 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx @@ -1,17 +1,17 @@ - @@ -993,6 +993,9 @@ 更多地址 (url),用逗号 (,) 分隔;订阅转换将失效 + + {0} : {1}/s↑ | {2}/s↓ + 自动更新间隔 (分钟) @@ -1557,4 +1560,7 @@ 多配置文件故障转移 Xray + + 静默启动 + \ No newline at end of file diff --git a/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx b/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx index 3101cb2f..42f72578 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx @@ -1,17 +1,17 @@ - @@ -993,6 +993,9 @@ 更多位址 (url),用逗號 (,) 分隔;訂閱轉換將失效 + + {0} : {1}/s↑ | {2}/s↓ + 自動更新間隔 (分鐘) @@ -1557,4 +1560,7 @@ Multi-Configuration Fallback by Xray + + 静默启动 + \ No newline at end of file diff --git a/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs b/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs index 06ca3184..2fa650b8 100644 --- a/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs @@ -578,7 +578,7 @@ public class MainWindowViewModel : MyReactiveObject private async Task AutoHideStartup() { - if (_config.UiItem.AutoHideStartup) + if (_config.UiItem.AutoHideStartup && !_config.UiItem.SilentStartup) { AppEvents.ShowHideWindowRequested.Publish(false); } diff --git a/v2rayN/ServiceLib/ViewModels/OptionSettingViewModel.cs b/v2rayN/ServiceLib/ViewModels/OptionSettingViewModel.cs index 7f446cf2..4712efe4 100644 --- a/v2rayN/ServiceLib/ViewModels/OptionSettingViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/OptionSettingViewModel.cs @@ -54,6 +54,7 @@ public class OptionSettingViewModel : MyReactiveObject [Reactive] public bool EnableUpdateSubOnlyRemarksExist { get; set; } [Reactive] public bool EnableSecurityProtocolTls13 { get; set; } [Reactive] public bool AutoHideStartup { get; set; } + [Reactive] public bool SilentStartup { get; set; } [Reactive] public bool Hide2TrayWhenClose { get; set; } [Reactive] public bool EnableDragDropSort { get; set; } [Reactive] public bool DoubleClick2Activate { get; set; } @@ -172,6 +173,7 @@ public class OptionSettingViewModel : MyReactiveObject EnableUpdateSubOnlyRemarksExist = _config.UiItem.EnableUpdateSubOnlyRemarksExist; EnableSecurityProtocolTls13 = _config.GuiItem.EnableSecurityProtocolTls13; AutoHideStartup = _config.UiItem.AutoHideStartup; + SilentStartup = _config.UiItem.SilentStartup; Hide2TrayWhenClose = _config.UiItem.Hide2TrayWhenClose; EnableDragDropSort = _config.UiItem.EnableDragDropSort; DoubleClick2Activate = _config.UiItem.DoubleClick2Activate; @@ -332,6 +334,7 @@ public class OptionSettingViewModel : MyReactiveObject _config.UiItem.EnableUpdateSubOnlyRemarksExist = EnableUpdateSubOnlyRemarksExist; _config.GuiItem.EnableSecurityProtocolTls13 = EnableSecurityProtocolTls13; _config.UiItem.AutoHideStartup = AutoHideStartup; + _config.UiItem.SilentStartup = SilentStartup; _config.UiItem.Hide2TrayWhenClose = Hide2TrayWhenClose; _config.GuiItem.AutoUpdateInterval = AutoUpdateInterval; _config.UiItem.EnableDragDropSort = EnableDragDropSort; diff --git a/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs b/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs index 82d33833..b379107a 100644 --- a/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs @@ -31,6 +31,11 @@ public partial class MainWindow : WindowBase _config = AppManager.Instance.Config; _manager = new WindowNotificationManager(TopLevel.GetTopLevel(this)) { MaxItems = 3, Position = NotificationPosition.TopRight }; + if (_config.UiItem.SilentStartup) + { + this.WindowState = WindowState.Minimized; + } + this.KeyDown += MainWindow_KeyDown; menuSettingsSetUWP.Click += menuSettingsSetUWP_Click; menuPromotion.Click += menuPromotion_Click; @@ -438,6 +443,10 @@ public partial class MainWindow : WindowBase protected override void OnLoaded(object? sender, RoutedEventArgs e) { base.OnLoaded(sender, e); + if (_config.UiItem.SilentStartup) + { + this.Hide(); + } RestoreUI(); } diff --git a/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml b/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml index 727f96a0..750b533c 100644 --- a/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml +++ b/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml @@ -340,7 +340,7 @@ + RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto"> + + + this.Bind(ViewModel, vm => vm.EnableUpdateSubOnlyRemarksExist, v => v.togEnableUpdateSubOnlyRemarksExist.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.EnableSecurityProtocolTls13, v => v.togEnableSecurityProtocolTls13.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.AutoHideStartup, v => v.togAutoHideStartup.IsChecked).DisposeWith(disposables); + this.Bind(ViewModel, vm => vm.SilentStartup, v => v.togSilentStartup.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.Hide2TrayWhenClose, v => v.togHide2TrayWhenClose.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.DoubleClick2Activate, v => v.togDoubleClick2Activate.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.AutoUpdateInterval, v => v.txtautoUpdateInterval.Text).DisposeWith(disposables); From dc469527f8b98d9744ccaa6c85b13035571eccd4 Mon Sep 17 00:00:00 2001 From: Waheal <2035582067@qq.com> Date: Sun, 5 Oct 2025 22:28:43 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E7=BB=99MaterialUI=E7=89=88=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E9=9D=99=E9=BB=98=E5=90=AF=E5=8A=A8=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../v2rayN.Desktop/Views/MainWindow.axaml.cs | 3 +- .../Views/OptionSettingWindow.axaml | 100 +++++++++--------- v2rayN/v2rayN/Views/MainWindow.xaml.cs | 9 ++ v2rayN/v2rayN/Views/OptionSettingWindow.xaml | 14 +++ .../v2rayN/Views/OptionSettingWindow.xaml.cs | 1 + 5 files changed, 76 insertions(+), 51 deletions(-) diff --git a/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs b/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs index b379107a..73d4b0d7 100644 --- a/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs @@ -445,7 +445,8 @@ public partial class MainWindow : WindowBase base.OnLoaded(sender, e); if (_config.UiItem.SilentStartup) { - this.Hide(); + ShowHideWindow(false); + _config.UiItem.ShowInTaskbar = true; } RestoreUI(); } diff --git a/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml b/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml index 750b533c..062e5955 100644 --- a/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml +++ b/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml @@ -340,7 +340,7 @@ + RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto"> + + + + + + - - - - - - + + + vm.EnableUpdateSubOnlyRemarksExist, v => v.togEnableUpdateSubOnlyRemarksExist.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.EnableSecurityProtocolTls13, v => v.togEnableSecurityProtocolTls13.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.AutoHideStartup, v => v.togAutoHideStartup.IsChecked).DisposeWith(disposables); + this.Bind(ViewModel, vm => vm.SilentStartup, v => v.togSilentStartup.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.EnableDragDropSort, v => v.togEnableDragDropSort.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.DoubleClick2Activate, v => v.togDoubleClick2Activate.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.AutoUpdateInterval, v => v.txtautoUpdateInterval.Text).DisposeWith(disposables); From 604f093ef0a92e6eaab6daeadeb4389844dc9782 Mon Sep 17 00:00:00 2001 From: Waheal <2035582067@qq.com> Date: Mon, 6 Oct 2025 14:38:21 +0800 Subject: [PATCH 3/3] disable the SilentStartup for Linux --- v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml | 1 + v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml.cs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml b/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml index 062e5955..6e88a8b6 100644 --- a/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml +++ b/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml @@ -455,6 +455,7 @@ HorizontalAlignment="Left" /> { txbSettingsExceptionTip.IsVisible = false; panSystemProxyAdvanced.IsVisible = false; + + labSilentStartup.IsVisible = false; + togSilentStartup.IsVisible = false; } else if (Utils.IsOSX()) {