Skip to content

Commit

Permalink
2.0.0.7-beta
Browse files Browse the repository at this point in the history
修复 主题跟随系统内嵌网页主题不正确
目标框架TFM 升级至 6.0 解决 Win7 上存在的一些兼容性问题
  • Loading branch information
AigioL committed May 1, 2021
1 parent b4158be commit 1846854
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 358 deletions.
348 changes: 0 additions & 348 deletions SteamToolsV2+.sln

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Common.CoreLib/Properties/ThisAssembly.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ namespace System.Properties
{
public static class ThisAssembly
{
public const string Version = "2.0.0.6";
public const string Version = "2.0.0.7";

public const string InfoVersion = Version + "-beta";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>WinExe</OutputType>
<!--<DefineConstants>StartupTrace;$(DefineConstants)</DefineConstants>-->
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<SignAssembly>false</SignAssembly>
<!--(SignAssembly)对此程序集进行签名会导致编译失败(CompileAvaloniaXamlTask)-->
<RootNamespace>System.Application.UI</RootNamespace>
Expand Down
21 changes: 19 additions & 2 deletions src/ST.Client.Desktop.Avalonia/Application/UI/CefNetApp.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Avalonia.Threading;
using Avalonia.Threading;
using CefNet;
using System.Application.Models;
using System.Globalization;
Expand Down Expand Up @@ -205,9 +205,26 @@ public static string GetTheme()
var theme = AppHelper.Current.Theme;
return theme switch
{
AppTheme.FollowingSystem => "auto",
AppTheme.FollowingSystem => GetThemeStringByFollowingSystem(),
_ => theme.ToString(),
};
static string GetThemeStringByFollowingSystem()
{
if (DI.Platform == Platform.Windows)
{
var major = Environment.OSVersion.Version.Major;
if (major < 10 || major == 10 && Environment.OSVersion.Version.Build < 18282)
{
goto dark;
}
}
else if (DI.Platform == Platform.Linux)
{
goto dark;
}
return "auto";
dark: return AppTheme.Dark.ToString();
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Microsoft.Win32;
using Microsoft.Win32;
using System.Application.Models;
using System.Application.UI;
using System.Management;
Expand Down Expand Up @@ -42,9 +42,8 @@ public bool? IsLightOrDarkTheme

public void SetLightOrDarkThemeFollowingSystem(bool enable)
{
if (Environment.OSVersion.Version.Major < 10) return;
if (Environment.OSVersion.Version.Major == 10 &&
Environment.OSVersion.Version.Build < 18282) return;
var major = Environment.OSVersion.Version.Major;
if (major < 10 || major == 10 && Environment.OSVersion.Version.Build < 18282) return;

var currentUser = WindowsIdentity.GetCurrent()?.User;
if (currentUser == null) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@
using System.Drawing.Text;
using System.Globalization;
using System.Linq;
using System.Net.NetworkInformation;
using System.Security;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using static Newtonsoft.Json.JsonConvert;

namespace System.Application.UI.ViewModels
Expand Down Expand Up @@ -301,6 +299,7 @@ static async Task TestSecurityStorage()

public async void TestServerApiButton_Click()
{
#if DEBUG
DebugString = string.Empty;
var client = ICloudServiceClient.Instance;

Expand Down Expand Up @@ -334,6 +333,11 @@ public async void TestServerApiButton_Click()
var jsonStr = Serializable2.S(rsp2.Content);

DebugString = $"JSON: {jsonStr}";

#else
await Task.Delay(300);
DebugString = nameof(TestServerApiButton_Click);
#endif
}

/// <summary>
Expand Down

0 comments on commit 1846854

Please sign in to comment.