Skip to content

Commit 863b9a8

Browse files
committed
Update .NET to v10 to test dark UI
1 parent 41e428f commit 863b9a8

File tree

7 files changed

+43
-42
lines changed

7 files changed

+43
-42
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
- uses: actions/setup-dotnet@v5
2323
with:
24-
dotnet-version: 8.0.x
24+
dotnet-version: 10.0.x
2525

2626
- uses: microsoft/setup-msbuild@v2
2727

@@ -41,7 +41,7 @@ jobs:
4141
- uses: actions/upload-artifact@v4
4242
with:
4343
name: exe-${{ matrix.platform }}
44-
path: src\bin\Release\net8.0-windows10.0.19041.0\win-${{ matrix.platform }}\publish\*.exe
44+
path: src\bin\Release\net10.0-windows10.0.19041.0\win-${{ matrix.platform }}\publish\*.exe
4545

4646
- run: msbuild uwp\WinDynamicDesktop.Package.wapproj /v:m /p:AppxBundle=$env:AppxBundle /p:Configuration=$env:Configuration /p:Platform=$env:Platform /p:UapAppxPackageBuildMode=$env:UapAppxPackageBuildMode /p:UseTemporarySignCert=$env:UseTemporarySignCert
4747
env:
@@ -66,7 +66,7 @@ jobs:
6666

6767
- uses: actions/setup-dotnet@v5
6868
with:
69-
dotnet-version: 8.0.x
69+
dotnet-version: 10.0.x
7070

7171
- run: |
7272
cp .env.example .env

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
- uses: actions/setup-dotnet@v5
1919
with:
20-
dotnet-version: 8.0.x
20+
dotnet-version: 10.0.x
2121

2222
- uses: microsoft/setup-msbuild@v2
2323

scripts/package.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ dotnet restore WinDynamicDesktop.sln
1515

1616
foreach ($platform in $appPlatforms) {
1717
dotnet publish src\WinDynamicDesktop.csproj -a $platform -c Release --no-restore --self-contained -p:EnableCompressionInSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:PublishSingleFile=true
18-
Copy-Item -Path "src\bin\Release\net8.0-windows10.0.19041.0\win-$platform\publish\WinDynamicDesktop.exe" -Destination "dist\WinDynamicDesktop_$appVersion`_$platform`_Portable.exe"
18+
Copy-Item -Path "src\bin\Release\net10.0-windows10.0.19041.0\win-$platform\publish\WinDynamicDesktop.exe" -Destination "dist\WinDynamicDesktop_$appVersion`_$platform`_Portable.exe"
1919

2020
iscc scripts\installer.iss /dMyAppPlatform="$platform" /dMyAppVersion="$appVersion"
2121
}

src/DarkUI.cs

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -22,48 +22,48 @@ public static bool IsDark
2222

2323
public static void ThemeForm(Form form, bool onInit = true)
2424
{
25-
if (onInit && IsSupported)
26-
{
27-
DarkNet.Instance.SetWindowThemeForms(form, Theme.Auto);
28-
}
25+
//if (onInit && IsSupported)
26+
//{
27+
// DarkNet.Instance.SetWindowThemeForms(form, Theme.Auto);
28+
//}
2929

30-
form.BackColor = IsDark ? bgColorDark : default;
31-
form.ForeColor = IsDark ? fgColorDark : default;
30+
//form.BackColor = IsDark ? bgColorDark : default;
31+
//form.ForeColor = IsDark ? fgColorDark : default;
3232

33-
foreach (Control childControl in GetControls(form))
34-
{
35-
childControl.BackColor = IsDark ? bgColorDark : default;
36-
childControl.ForeColor = IsDark ? fgColorDark : default;
33+
//foreach (Control childControl in GetControls(form))
34+
//{
35+
// childControl.BackColor = IsDark ? bgColorDark : default;
36+
// childControl.ForeColor = IsDark ? fgColorDark : default;
3737

38-
if (childControl is LinkLabel)
39-
{
40-
((LinkLabel)childControl).LinkColor = IsDark ? Color.LightBlue : default;
41-
}
38+
// if (childControl is LinkLabel)
39+
// {
40+
// ((LinkLabel)childControl).LinkColor = IsDark ? Color.LightBlue : default;
41+
// }
4242

43-
if (onInit)
44-
{
45-
childControl.Paint += (object sender, PaintEventArgs e) =>
46-
{
47-
if (IsDark && !childControl.Enabled)
48-
{
49-
TextRenderer.DrawText(e.Graphics, childControl.Text, childControl.Font,
50-
childControl.ClientRectangle, Color.Gray);
51-
}
52-
};
53-
}
54-
}
43+
// if (onInit)
44+
// {
45+
// childControl.Paint += (object sender, PaintEventArgs e) =>
46+
// {
47+
// if (IsDark && !childControl.Enabled)
48+
// {
49+
// TextRenderer.DrawText(e.Graphics, childControl.Text, childControl.Font,
50+
// childControl.ClientRectangle, Color.Gray);
51+
// }
52+
// };
53+
// }
54+
//}
5555
}
5656

5757
public static void ThemeMenu(ContextMenuStrip menu)
5858
{
59-
if (IsDark)
60-
{
61-
menu.Renderer = new ToolStripSystemDarkModeRenderer();
62-
}
63-
else
64-
{
65-
menu.Renderer = new ToolStripSystemRenderer();
66-
}
59+
//if (IsDark)
60+
//{
61+
// menu.Renderer = new ToolStripSystemDarkModeRenderer();
62+
//}
63+
//else
64+
//{
65+
// menu.Renderer = new ToolStripSystemRenderer();
66+
//}
6767
}
6868

6969
public static void UserDefaultAppThemeIsDarkChanged(object sender, bool isDark)

src/Program.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ static void Main(string[] args)
2727
// To customize application configuration such as set high DPI settings or default font,
2828
// see https://aka.ms/applicationconfiguration.
2929
ApplicationConfiguration.Initialize();
30+
Application.SetColorMode(SystemColorMode.System);
3031
Application.Run(new AppContext(args));
3132
}
3233

src/WinDynamicDesktop.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework Condition="$([MSBuild]::IsOSPlatform('Windows'))">net8.0-windows10.0.19041.0</TargetFramework>
4-
<TargetFramework Condition="!$([MSBuild]::IsOSPlatform('Windows'))">net8.0</TargetFramework>
3+
<TargetFramework Condition="$([MSBuild]::IsOSPlatform('Windows'))">net10.0-windows10.0.19041.0</TargetFramework>
4+
<TargetFramework Condition="!$([MSBuild]::IsOSPlatform('Windows'))">net10.0</TargetFramework>
55
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
66
<Platforms>AnyCPU;x86;x64;ARM64</Platforms>
77
<OutputType>WinExe</OutputType>

test/WinDynamicDesktop.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
4+
<TargetFramework>net10.0-windows10.0.19041.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77

0 commit comments

Comments
 (0)