Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
20457e9e63 | ||
|
|
e63042af84 | ||
|
|
c35b4d3c1b | ||
|
|
64a83a5d64 | ||
|
|
01039d0b47 | ||
|
|
7c1e5a3cba | ||
|
|
038161527f | ||
|
|
b12b7a17e6 | ||
|
|
37cf23d5fe | ||
|
|
ed7fb4f6e3 | ||
|
|
5d4bd2fee6 | ||
|
|
aae5906311 | ||
|
|
4a7bafd011 | ||
|
|
626ebfe65d |
@@ -81,6 +81,7 @@ public static class ProcUtils
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var procId = review ? proc?.Id : null;
|
||||||
var fileName = review ? proc?.MainModule?.FileName : null;
|
var fileName = review ? proc?.MainModule?.FileName : null;
|
||||||
var processName = review ? proc?.ProcessName : null;
|
var processName = review ? proc?.ProcessName : null;
|
||||||
|
|
||||||
@@ -90,15 +91,27 @@ public static class ProcUtils
|
|||||||
try { proc?.Dispose(); } catch (Exception ex) { Logging.SaveLog(_tag, ex); }
|
try { proc?.Dispose(); } catch (Exception ex) { Logging.SaveLog(_tag, ex); }
|
||||||
|
|
||||||
await Task.Delay(300);
|
await Task.Delay(300);
|
||||||
if (review && fileName != null)
|
if (review && procId != null && fileName != null)
|
||||||
{
|
{
|
||||||
var proc2 = Process.GetProcessesByName(processName)
|
try
|
||||||
.FirstOrDefault(t => t.MainModule?.FileName == fileName);
|
|
||||||
if (proc2 != null)
|
|
||||||
{
|
{
|
||||||
Logging.SaveLog($"{_tag}, KillProcess not completing the job");
|
var lstProc = Process.GetProcessesByName(processName);
|
||||||
await ProcessKill(proc2, false);
|
foreach (var proc2 in lstProc)
|
||||||
proc2 = null;
|
{
|
||||||
|
if (proc2.Id == procId)
|
||||||
|
{
|
||||||
|
Logging.SaveLog($"{_tag}, KillProcess not completing the job, procId");
|
||||||
|
await ProcessKill(proc2, false);
|
||||||
|
}
|
||||||
|
if (proc2.MainModule != null && proc2.MainModule?.FileName == fileName)
|
||||||
|
{
|
||||||
|
Logging.SaveLog($"{_tag}, KillProcess not completing the job, fileName");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logging.SaveLog(_tag, ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ namespace ServiceLib.Common
|
|||||||
internal static class WindowsUtils
|
internal static class WindowsUtils
|
||||||
{
|
{
|
||||||
private static readonly string _tag = "WindowsUtils";
|
private static readonly string _tag = "WindowsUtils";
|
||||||
|
|
||||||
public static string? RegReadValue(string path, string name, string def)
|
public static string? RegReadValue(string path, string name, string def)
|
||||||
{
|
{
|
||||||
RegistryKey? regKey = null;
|
RegistryKey? regKey = null;
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using YamlDotNet.Core.Tokens;
|
namespace ServiceLib.Handler
|
||||||
|
|
||||||
namespace ServiceLib.Handler
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Core configuration file processing class
|
/// Core configuration file processing class
|
||||||
|
|||||||
@@ -93,8 +93,9 @@
|
|||||||
{
|
{
|
||||||
return LstInterface;
|
return LstInterface;
|
||||||
}
|
}
|
||||||
var lst = services.Split(Environment.NewLine);
|
|
||||||
return lst.Length > 0 ? LstInterface.Intersect(lst).ToList() : LstInterface;
|
var lst = services.Split(Environment.NewLine).Where(t => t.Length > 0 && t.Contains('*') == false);
|
||||||
|
return lst.ToList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
public static class SysProxyHandler
|
public static class SysProxyHandler
|
||||||
{
|
{
|
||||||
private static readonly string _tag = "SysProxyHandler";
|
private static readonly string _tag = "SysProxyHandler";
|
||||||
|
|
||||||
public static async Task<bool> UpdateSysProxy(Config config, bool forceDisable)
|
public static async Task<bool> UpdateSysProxy(Config config, bool forceDisable)
|
||||||
{
|
{
|
||||||
var type = config.SystemProxyItem.SysProxyType;
|
var type = config.SystemProxyItem.SysProxyType;
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ namespace ServiceLib.Handler
|
|||||||
private readonly string _webFileName = "backup.zip";
|
private readonly string _webFileName = "backup.zip";
|
||||||
private readonly string _tag = "WebDav--";
|
private readonly string _tag = "WebDav--";
|
||||||
|
|
||||||
|
|
||||||
public WebDavHandler()
|
public WebDavHandler()
|
||||||
{
|
{
|
||||||
_config = AppHandler.Instance.Config;
|
_config = AppHandler.Instance.Config;
|
||||||
|
|||||||
@@ -5,24 +5,25 @@
|
|||||||
"loglevel": "warning"
|
"loglevel": "warning"
|
||||||
},
|
},
|
||||||
"inbounds": [],
|
"inbounds": [],
|
||||||
"outbounds": [{
|
"outbounds": [
|
||||||
|
{
|
||||||
"tag": "proxy",
|
"tag": "proxy",
|
||||||
"protocol": "vmess",
|
"protocol": "vmess",
|
||||||
"settings": {
|
"settings": {
|
||||||
"vnext": [{
|
"vnext": [{
|
||||||
"address": "v2ray.cool",
|
"address": "",
|
||||||
"port": 10086,
|
"port": 0,
|
||||||
"users": [{
|
"users": [{
|
||||||
"id": "a3482e88-686a-4a58-8126-99c9df64b7bf",
|
"id": "",
|
||||||
"security": "auto"
|
"security": "auto"
|
||||||
}]
|
}]
|
||||||
}],
|
}],
|
||||||
"servers": [{
|
"servers": [{
|
||||||
"address": "v2ray.cool",
|
"address": "",
|
||||||
"method": "chacha20",
|
"method": "",
|
||||||
"ota": false,
|
"ota": false,
|
||||||
"password": "123456",
|
"password": "",
|
||||||
"port": 10086,
|
"port": 0,
|
||||||
"level": 1
|
"level": 1
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
@@ -35,27 +36,23 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"protocol": "freedom",
|
"protocol": "freedom",
|
||||||
"settings": {},
|
|
||||||
"tag": "direct"
|
"tag": "direct"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"protocol": "blackhole",
|
"protocol": "blackhole",
|
||||||
"tag": "block",
|
"tag": "block"
|
||||||
"settings": {
|
|
||||||
"response": {
|
|
||||||
"type": "http"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"routing": {
|
"routing": {
|
||||||
"domainStrategy": "IPIfNonMatch",
|
"domainStrategy": "IPIfNonMatch",
|
||||||
"rules": [
|
"rules": [
|
||||||
{
|
{
|
||||||
"inboundTag": ["api"],
|
"inboundTag": [
|
||||||
"outboundTag": "api",
|
"api"
|
||||||
"type": "field"
|
],
|
||||||
}
|
"outboundTag": "api",
|
||||||
|
"type": "field"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
<TargetFramework>net8.0</TargetFramework>
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<Version>7.5.2</Version>
|
<Version>7.5.5</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -313,7 +313,7 @@ namespace ServiceLib.Services.CoreConfig
|
|||||||
var outbound = JsonUtils.Deserialize<Outbound4Sbox>(txtOutbound);
|
var outbound = JsonUtils.Deserialize<Outbound4Sbox>(txtOutbound);
|
||||||
await GenOutbound(item, outbound);
|
await GenOutbound(item, outbound);
|
||||||
outbound.tag = $"{Global.ProxyTag}-{tagProxy.Count + 1}";
|
outbound.tag = $"{Global.ProxyTag}-{tagProxy.Count + 1}";
|
||||||
singboxConfig.outbounds.Add(outbound);
|
singboxConfig.outbounds.Insert(0, outbound);
|
||||||
tagProxy.Add(outbound.tag);
|
tagProxy.Add(outbound.tag);
|
||||||
}
|
}
|
||||||
if (tagProxy.Count <= 0)
|
if (tagProxy.Count <= 0)
|
||||||
@@ -333,7 +333,7 @@ namespace ServiceLib.Services.CoreConfig
|
|||||||
outbounds = tagProxy,
|
outbounds = tagProxy,
|
||||||
interrupt_exist_connections = false,
|
interrupt_exist_connections = false,
|
||||||
};
|
};
|
||||||
singboxConfig.outbounds.Add(outUrltest);
|
singboxConfig.outbounds.Insert(0, outUrltest);
|
||||||
|
|
||||||
//add selector outbound
|
//add selector outbound
|
||||||
var outSelector = new Outbound4Sbox
|
var outSelector = new Outbound4Sbox
|
||||||
@@ -344,7 +344,7 @@ namespace ServiceLib.Services.CoreConfig
|
|||||||
interrupt_exist_connections = false,
|
interrupt_exist_connections = false,
|
||||||
};
|
};
|
||||||
outSelector.outbounds.Insert(0, outUrltest.tag);
|
outSelector.outbounds.Insert(0, outUrltest.tag);
|
||||||
singboxConfig.outbounds.Add(outSelector);
|
singboxConfig.outbounds.Insert(0, outSelector);
|
||||||
|
|
||||||
ret.Success = true;
|
ret.Success = true;
|
||||||
ret.Data = JsonUtils.Serialize(singboxConfig);
|
ret.Data = JsonUtils.Serialize(singboxConfig);
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ namespace ServiceLib.Services.CoreConfig
|
|||||||
var outbound = JsonUtils.Deserialize<Outbounds4Ray>(txtOutbound);
|
var outbound = JsonUtils.Deserialize<Outbounds4Ray>(txtOutbound);
|
||||||
await GenOutbound(item, outbound);
|
await GenOutbound(item, outbound);
|
||||||
outbound.tag = $"{Global.ProxyTag}-{tagProxy.Count + 1}";
|
outbound.tag = $"{Global.ProxyTag}-{tagProxy.Count + 1}";
|
||||||
v2rayConfig.outbounds.Add(outbound);
|
v2rayConfig.outbounds.Insert(0, outbound);
|
||||||
tagProxy.Add(outbound.tag);
|
tagProxy.Add(outbound.tag);
|
||||||
}
|
}
|
||||||
if (tagProxy.Count <= 0)
|
if (tagProxy.Count <= 0)
|
||||||
@@ -182,15 +182,12 @@ namespace ServiceLib.Services.CoreConfig
|
|||||||
rule.balancerTag = balancer.tag;
|
rule.balancerTag = balancer.tag;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
v2rayConfig.routing.rules.Add(new()
|
||||||
{
|
{
|
||||||
v2rayConfig.routing.rules.Add(new()
|
network = "tcp,udp",
|
||||||
{
|
balancerTag = balancer.tag,
|
||||||
network = "tcp,udp",
|
type = "field"
|
||||||
balancerTag = balancer.tag,
|
});
|
||||||
type = "field"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
ret.Success = true;
|
ret.Success = true;
|
||||||
ret.Data = JsonUtils.Serialize(v2rayConfig);
|
ret.Data = JsonUtils.Serialize(v2rayConfig);
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ namespace ServiceLib.Services
|
|||||||
public event EventHandler<RetResult>? UpdateCompleted;
|
public event EventHandler<RetResult>? UpdateCompleted;
|
||||||
|
|
||||||
public event ErrorEventHandler? Error;
|
public event ErrorEventHandler? Error;
|
||||||
|
|
||||||
private static readonly string _tag = "DownloadService";
|
private static readonly string _tag = "DownloadService";
|
||||||
|
|
||||||
public async Task<int> DownloadDataAsync(string url, WebProxy webProxy, int downloadTimeout, Action<bool, string> updateFunc)
|
public async Task<int> DownloadDataAsync(string url, WebProxy webProxy, int downloadTimeout, Action<bool, string> updateFunc)
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ namespace ServiceLib.ViewModels
|
|||||||
ProcUtils.ProcessStart(upgradeFileName, Global.RebootAs, Utils.StartupPath());
|
ProcUtils.ProcessStart(upgradeFileName, Global.RebootAs, Utils.StartupPath());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
service?.Shutdown();
|
service?.Shutdown(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -303,7 +303,7 @@ namespace ServiceLib.ViewModels
|
|||||||
{
|
{
|
||||||
if (!blWindowsShutDown)
|
if (!blWindowsShutDown)
|
||||||
{
|
{
|
||||||
_updateView?.Invoke(EViewAction.Shutdown, null);
|
_updateView?.Invoke(EViewAction.Shutdown, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -329,9 +329,9 @@ namespace ServiceLib.ViewModels
|
|||||||
_updateView?.Invoke(EViewAction.ShowHideWindow, blShow);
|
_updateView?.Invoke(EViewAction.ShowHideWindow, blShow);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Shutdown()
|
public void Shutdown(bool byUser)
|
||||||
{
|
{
|
||||||
_updateView?.Invoke(EViewAction.Shutdown, null);
|
_updateView?.Invoke(EViewAction.Shutdown, byUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Actions
|
#endregion Actions
|
||||||
|
|||||||
@@ -3,12 +3,13 @@
|
|||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
|
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
|
||||||
|
xmlns:semi="https://irihi.tech/semi"
|
||||||
xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
|
xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
|
||||||
x:DataType="vms:StatusBarViewModel"
|
x:DataType="vms:StatusBarViewModel"
|
||||||
RequestedThemeVariant="Default">
|
RequestedThemeVariant="Default">
|
||||||
<Application.Styles>
|
<Application.Styles>
|
||||||
|
<semi:SemiTheme />
|
||||||
<StyleInclude Source="Assets/GlobalStyles.axaml" />
|
<StyleInclude Source="Assets/GlobalStyles.axaml" />
|
||||||
<StyleInclude Source="avares://Semi.Avalonia/Themes/Index.axaml" />
|
|
||||||
<StyleInclude Source="avares://Semi.Avalonia.DataGrid/Index.axaml" />
|
<StyleInclude Source="avares://Semi.Avalonia.DataGrid/Index.axaml" />
|
||||||
<StyleInclude Source="avares://DialogHost.Avalonia/Styles.xaml" />
|
<StyleInclude Source="avares://DialogHost.Avalonia/Styles.xaml" />
|
||||||
</Application.Styles>
|
</Application.Styles>
|
||||||
|
|||||||
@@ -71,12 +71,8 @@ public partial class App : Application
|
|||||||
|
|
||||||
private async void MenuExit_Click(object? sender, EventArgs e)
|
private async void MenuExit_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
var service = Locator.Current.GetService<MainWindowViewModel>();
|
||||||
{
|
if (service != null) await service.MyAppExitAsync(true);
|
||||||
var service = Locator.Current.GetService<MainWindowViewModel>();
|
service?.Shutdown(true);
|
||||||
if (service != null) await service.MyAppExitAsync(false);
|
|
||||||
|
|
||||||
desktop.Shutdown();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -31,6 +31,7 @@ namespace v2rayN.Desktop.ViewModels
|
|||||||
{
|
{
|
||||||
ModifyTheme();
|
ModifyTheme();
|
||||||
ModifyFontFamily();
|
ModifyFontFamily();
|
||||||
|
ModifyFontSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BindingUI()
|
private void BindingUI()
|
||||||
@@ -67,11 +68,10 @@ namespace v2rayN.Desktop.ViewModels
|
|||||||
y => y > 0)
|
y => y > 0)
|
||||||
.Subscribe(c =>
|
.Subscribe(c =>
|
||||||
{
|
{
|
||||||
if (CurrentFontSize >= Global.MinFontSize)
|
if (_config.UiItem.CurrentFontSize != CurrentFontSize && CurrentFontSize >= Global.MinFontSize)
|
||||||
{
|
{
|
||||||
_config.UiItem.CurrentFontSize = CurrentFontSize;
|
_config.UiItem.CurrentFontSize = CurrentFontSize;
|
||||||
double size = CurrentFontSize;
|
ModifyFontSize();
|
||||||
ModifyFontSize(size);
|
|
||||||
ConfigHandler.SaveConfig(_config);
|
ConfigHandler.SaveConfig(_config);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -100,8 +100,11 @@ namespace v2rayN.Desktop.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ModifyFontSize(double size)
|
private void ModifyFontSize()
|
||||||
{
|
{
|
||||||
|
double size = CurrentFontSize;
|
||||||
|
if (size < Global.MinFontSize) return;
|
||||||
|
|
||||||
Style style = new(x => Selectors.Or(
|
Style style = new(x => Selectors.Or(
|
||||||
x.OfType<Button>(),
|
x.OfType<Button>(),
|
||||||
x.OfType<TextBox>(),
|
x.OfType<TextBox>(),
|
||||||
|
|||||||
@@ -223,6 +223,10 @@ namespace v2rayN.Desktop.Views
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case EViewAction.Shutdown:
|
case EViewAction.Shutdown:
|
||||||
|
if (obj != null && _blCloseByUser == false)
|
||||||
|
{
|
||||||
|
_blCloseByUser = (bool)obj;
|
||||||
|
}
|
||||||
StorageUI();
|
StorageUI();
|
||||||
if (Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
if (Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -28,8 +28,8 @@
|
|||||||
<PackageReference Include="Avalonia.ReactiveUI" Version="11.2.3" />
|
<PackageReference Include="Avalonia.ReactiveUI" Version="11.2.3" />
|
||||||
<PackageReference Include="DialogHost.Avalonia" Version="0.8.1" />
|
<PackageReference Include="DialogHost.Avalonia" Version="0.8.1" />
|
||||||
<PackageReference Include="MessageBox.Avalonia" Version="3.2.0" />
|
<PackageReference Include="MessageBox.Avalonia" Version="3.2.0" />
|
||||||
<PackageReference Include="Semi.Avalonia" Version="11.2.1.2" />
|
<PackageReference Include="Semi.Avalonia" Version="11.2.1.3" />
|
||||||
<PackageReference Include="Semi.Avalonia.DataGrid" Version="11.2.1.2" />
|
<PackageReference Include="Semi.Avalonia.DataGrid" Version="11.2.1.3" />
|
||||||
<PackageReference Include="ReactiveUI" Version="20.1.63" />
|
<PackageReference Include="ReactiveUI" Version="20.1.63" />
|
||||||
<PackageReference Include="ReactiveUI.Fody" Version="19.5.41" />
|
<PackageReference Include="ReactiveUI.Fody" Version="19.5.41" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ namespace v2rayN
|
|||||||
internal static class WindowsUtils
|
internal static class WindowsUtils
|
||||||
{
|
{
|
||||||
private static readonly string _tag = "WindowsUtils";
|
private static readonly string _tag = "WindowsUtils";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取剪贴板数
|
/// 获取剪贴板数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ namespace v2rayN.ViewModels
|
|||||||
private void RestoreUI()
|
private void RestoreUI()
|
||||||
{
|
{
|
||||||
ModifyTheme();
|
ModifyTheme();
|
||||||
|
ModifyFontSize();
|
||||||
if (!_config.UiItem.ColorPrimaryName.IsNullOrEmpty())
|
if (!_config.UiItem.ColorPrimaryName.IsNullOrEmpty())
|
||||||
{
|
{
|
||||||
var swatch = new SwatchesProvider().Swatches.FirstOrDefault(t => t.Name == _config.UiItem.ColorPrimaryName);
|
var swatch = new SwatchesProvider().Swatches.FirstOrDefault(t => t.Name == _config.UiItem.ColorPrimaryName);
|
||||||
@@ -121,14 +122,10 @@ namespace v2rayN.ViewModels
|
|||||||
y => y > 0)
|
y => y > 0)
|
||||||
.Subscribe(c =>
|
.Subscribe(c =>
|
||||||
{
|
{
|
||||||
if (CurrentFontSize >= Global.MinFontSize)
|
if (_config.UiItem.CurrentFontSize != CurrentFontSize)
|
||||||
{
|
{
|
||||||
_config.UiItem.CurrentFontSize = CurrentFontSize;
|
_config.UiItem.CurrentFontSize = CurrentFontSize;
|
||||||
double size = (long)CurrentFontSize;
|
ModifyFontSize();
|
||||||
Application.Current.Resources["StdFontSize"] = size;
|
|
||||||
Application.Current.Resources["StdFontSize1"] = size + 1;
|
|
||||||
Application.Current.Resources["StdFontSize-1"] = size - 1;
|
|
||||||
|
|
||||||
ConfigHandler.SaveConfig(_config);
|
ConfigHandler.SaveConfig(_config);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -158,6 +155,16 @@ namespace v2rayN.ViewModels
|
|||||||
WindowsUtils.SetDarkBorder(Application.Current.MainWindow, isDarkTheme);
|
WindowsUtils.SetDarkBorder(Application.Current.MainWindow, isDarkTheme);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ModifyFontSize()
|
||||||
|
{
|
||||||
|
double size = (long)CurrentFontSize;
|
||||||
|
if (size < Global.MinFontSize) return;
|
||||||
|
|
||||||
|
Application.Current.Resources["StdFontSize"] = size;
|
||||||
|
Application.Current.Resources["StdFontSize1"] = size + 1;
|
||||||
|
Application.Current.Resources["StdFontSize-1"] = size - 1;
|
||||||
|
}
|
||||||
|
|
||||||
public void ChangePrimaryColor(System.Windows.Media.Color color)
|
public void ChangePrimaryColor(System.Windows.Media.Color color)
|
||||||
{
|
{
|
||||||
var theme = _paletteHelper.GetTheme();
|
var theme = _paletteHelper.GetTheme();
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="MaterialDesignThemes" Version="5.1.0" />
|
<PackageReference Include="MaterialDesignThemes" Version="5.2.0" />
|
||||||
<PackageReference Include="H.NotifyIcon.Wpf" Version="2.2.0" />
|
<PackageReference Include="H.NotifyIcon.Wpf" Version="2.2.0" />
|
||||||
<PackageReference Include="ReactiveUI.Fody" Version="19.5.41" />
|
<PackageReference Include="ReactiveUI.Fody" Version="19.5.41" />
|
||||||
<PackageReference Include="ReactiveUI.WPF" Version="20.1.63" />
|
<PackageReference Include="ReactiveUI.WPF" Version="20.1.63" />
|
||||||
|
|||||||
Reference in New Issue
Block a user