diff --git a/v2rayN/ServiceLib/Models/ConfigItems.cs b/v2rayN/ServiceLib/Models/ConfigItems.cs index 06bcfbeb..7de1794c 100644 --- a/v2rayN/ServiceLib/Models/ConfigItems.cs +++ b/v2rayN/ServiceLib/Models/ConfigItems.cs @@ -80,7 +80,7 @@ public bool IgnoreGeoUpdateCore { get; set; } = true; public int AutoUpdateInterval { get; set; } - + public bool EnableSecurityProtocolTls13 { get; set; } public int TrayMenuServersLimit { get; set; } = 20; @@ -116,6 +116,7 @@ public bool EnableDragDropSort { get; set; } public bool DoubleClick2Activate { get; set; } public bool AutoHideStartup { get; set; } + public bool Hide2TrayWhenClose { get; set; } public List MainColumnItem { get; set; } public bool ShowInTaskbar { get; set; } } diff --git a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs index fa71ced0..a439d7c0 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs +++ b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs @@ -3103,6 +3103,15 @@ namespace ServiceLib.Resx { } } + /// + /// 查找类似 Hide to tray when closing the window 的本地化字符串。 + /// + public static string TbSettingsHide2TrayWhenClose { + get { + return ResourceManager.GetString("TbSettingsHide2TrayWhenClose", resourceCulture); + } + } + /// /// 查找类似 HTTP Port 的本地化字符串。 /// diff --git a/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx b/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx index 0bf2fecb..937d107f 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx @@ -1387,4 +1387,7 @@ XHTTP Extra raw JSON, format: { XHTTPObject } + + Hide to tray when closing the window + \ No newline at end of file diff --git a/v2rayN/ServiceLib/Resx/ResUI.resx b/v2rayN/ServiceLib/Resx/ResUI.resx index 1d6b722b..af6a2c9e 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.resx @@ -1387,4 +1387,7 @@ XHTTP Extra raw JSON, format: { XHTTPObject } + + Hide to tray when closing the window + \ No newline at end of file diff --git a/v2rayN/ServiceLib/Resx/ResUI.ru.resx b/v2rayN/ServiceLib/Resx/ResUI.ru.resx index de7bce46..8758825c 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.ru.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.ru.resx @@ -1387,4 +1387,7 @@ XHTTP Extra raw JSON, format: { XHTTPObject } + + Hide to tray when closing the window + \ 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 55e14aed..9fd66a6e 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx @@ -1384,4 +1384,7 @@ XHTTP Extra 原始 JSON,格式: { XHTTPObject } + + 关闭窗口时隐藏至托盘 + \ 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 528ed027..c452a2ff 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx @@ -1384,4 +1384,7 @@ XHTTP Extra 原始 JSON,格式: { XHTTPObject } + + 關閉視窗時隱藏至托盤 + \ No newline at end of file diff --git a/v2rayN/ServiceLib/ViewModels/CheckUpdateViewModel.cs b/v2rayN/ServiceLib/ViewModels/CheckUpdateViewModel.cs index a62c3f2a..5890d614 100644 --- a/v2rayN/ServiceLib/ViewModels/CheckUpdateViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/CheckUpdateViewModel.cs @@ -267,7 +267,7 @@ namespace ServiceLib.ViewModels var filesList = (new DirectoryInfo(toPath)).GetFiles().Select(u => u.FullName).ToList(); foreach (var file in filesList) { - await Utils.SetLinuxChmod(Path.Combine(toPath, item.CoreType)); + await Utils.SetLinuxChmod(Path.Combine(toPath, item.CoreType.ToLower())); } } diff --git a/v2rayN/ServiceLib/ViewModels/OptionSettingViewModel.cs b/v2rayN/ServiceLib/ViewModels/OptionSettingViewModel.cs index e1608906..53fe1df6 100644 --- a/v2rayN/ServiceLib/ViewModels/OptionSettingViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/OptionSettingViewModel.cs @@ -53,6 +53,7 @@ namespace ServiceLib.ViewModels [Reactive] public bool EnableUpdateSubOnlyRemarksExist { get; set; } [Reactive] public bool EnableSecurityProtocolTls13 { get; set; } [Reactive] public bool AutoHideStartup { get; set; } + [Reactive] public bool Hide2TrayWhenClose { get; set; } [Reactive] public bool EnableDragDropSort { get; set; } [Reactive] public bool DoubleClick2Activate { get; set; } [Reactive] public int AutoUpdateInterval { get; set; } @@ -166,6 +167,7 @@ namespace ServiceLib.ViewModels EnableUpdateSubOnlyRemarksExist = _config.UiItem.EnableUpdateSubOnlyRemarksExist; EnableSecurityProtocolTls13 = _config.GuiItem.EnableSecurityProtocolTls13; AutoHideStartup = _config.UiItem.AutoHideStartup; + Hide2TrayWhenClose = _config.UiItem.Hide2TrayWhenClose; EnableDragDropSort = _config.UiItem.EnableDragDropSort; DoubleClick2Activate = _config.UiItem.DoubleClick2Activate; AutoUpdateInterval = _config.GuiItem.AutoUpdateInterval; @@ -316,6 +318,7 @@ namespace ServiceLib.ViewModels _config.UiItem.EnableUpdateSubOnlyRemarksExist = EnableUpdateSubOnlyRemarksExist; _config.GuiItem.EnableSecurityProtocolTls13 = EnableSecurityProtocolTls13; _config.UiItem.AutoHideStartup = AutoHideStartup; + _config.UiItem.Hide2TrayWhenClose = Hide2TrayWhenClose; _config.GuiItem.AutoUpdateInterval = AutoUpdateInterval; _config.UiItem.EnableDragDropSort = EnableDragDropSort; _config.UiItem.DoubleClick2Activate = DoubleClick2Activate; diff --git a/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs b/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs index 377e4689..a0ac88f8 100644 --- a/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs +++ b/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml.cs @@ -382,7 +382,7 @@ namespace v2rayN.Desktop.Views #endregion Event #region UI - + public void ShowHideWindow(bool? blShow) { var bl = blShow ?? !_config.UiItem.ShowInTaskbar; @@ -398,7 +398,7 @@ namespace v2rayN.Desktop.Views } else { - if (Utils.IsWindows()) + if (_config.UiItem.Hide2TrayWhenClose) { this.Hide(); } diff --git a/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml b/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml index 92919952..7f340867 100644 --- a/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml +++ b/v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml @@ -489,6 +489,18 @@ HorizontalAlignment="Left" Classes="Margin8" /> + + 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.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); this.Bind(ViewModel, vm => vm.CurrentFontFamily, v => v.cmbcurrentFontFamily.SelectedValue).DisposeWith(disposables);