Skip to content

Commit

Permalink
Release v2.1.0
Browse files Browse the repository at this point in the history
Fix system dark mode
  • Loading branch information
daniel-lerch committed Nov 29, 2024
1 parent 8cfcecc commit f8fe8ef
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Nullable>enable</Nullable>
<AvaloniaVersion>11.2.1</AvaloniaVersion>
<AvaloniaVersion>11.2.2</AvaloniaVersion>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion src/Vocup.Packaging/Package.appxmanifest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" IgnorableNamespaces="uap mp rescap">
<Identity Name="9961VectorData.Vocup" Publisher="CN=FDFCA12E-D0B5-4F1F-869D-7F97CD35B39E" Version="2.0.0.0" />
<Identity Name="9961VectorData.Vocup" Publisher="CN=FDFCA12E-D0B5-4F1F-869D-7F97CD35B39E" Version="2.1.0.0" />
<Properties>
<DisplayName>Vocup</DisplayName>
<PublisherDisplayName>Daniel Lerch</PublisherDisplayName>
Expand Down
5 changes: 3 additions & 2 deletions src/Vocup.WinForms/Util/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ public partial class App : Vocup.App
public override void OnFrameworkInitializationCompleted()
{
#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
RequestedThemeVariant = Application.ColorMode switch
RequestedThemeVariant = (Application.ColorMode, Application.SystemColorMode) switch
{
SystemColorMode.Dark => Avalonia.Styling.ThemeVariant.Dark,
(SystemColorMode.System, SystemColorMode.Dark) => Avalonia.Styling.ThemeVariant.Dark,
(SystemColorMode.Dark, _) => Avalonia.Styling.ThemeVariant.Dark,
_ => Avalonia.Styling.ThemeVariant.Light,
};
#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
Expand Down
2 changes: 1 addition & 1 deletion src/Vocup.WinForms/Vocup.WinForms.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<Description>Vocabulary training application</Description>
<Company>VectorData</Company>
<Copyright>Copyright © 2011 Florian Amstutz, © 2018-2024 Daniel Lerch.</Copyright>
<Version>2.0.0</Version>
<Version>2.1.0</Version>
<NeutralLanguage>en</NeutralLanguage>
</PropertyGroup>
<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions tests/Vocup.UnitTests/EvaluatorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void TestSynonymOrder()
[InlineData("anxiety; fear", "fear; anxiety")]
public void TestInlineSynonymOrder(string result, string input)
{
Assert.Equal(PracticeResult.Correct, evaluator.GetResult(new[] { result }, new[] { input }));
Assert.Equal(PracticeResult.Correct, evaluator.GetResult([result], [input]));
}

[Theory]
Expand All @@ -48,7 +48,7 @@ public void TestInlineSynonymOrder(string result, string input)
[InlineData("(to) crave (for) sth", "to crave (for) sth")] // half long, half original
public void TestOptionalExpressions(string result, string input)
{
Assert.Equal(PracticeResult.Correct, evaluator.GetResult(new[] { result }, new[] { input }));
Assert.Equal(PracticeResult.Correct, evaluator.GetResult([result], [input]));
}

[Theory]
Expand All @@ -59,6 +59,6 @@ public void TestOptionalExpressions(string result, string input)
[InlineData(PracticeResult.Wrong, "upset (about sth)/(that)", "upset/")]
public void TestOptionalEdgeCases(PracticeResult expected, string result, string input)
{
Assert.Equal(expected, evaluator.GetResult(new[] { result }, new[] { input }));
Assert.Equal(expected, evaluator.GetResult([result], [input]));
}
}
5 changes: 2 additions & 3 deletions tests/Vocup.UnitTests/ListCompositorTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using Vocup.Util;
using Xunit;

Expand All @@ -18,7 +17,7 @@ public void TestAddArgumentNull()
public void TestAddArgumentOutOfRange()
{
var compositor = new ListCompositor<int>();
Assert.Throws<ArgumentOutOfRangeException>(() => compositor.AddSource(new List<int>(), -0.3));
Assert.Throws<ArgumentOutOfRangeException>(() => compositor.AddSource([], -0.3));
}

[Fact]
Expand All @@ -27,7 +26,7 @@ public void TestToListArgumentOutOfRange()
var compositor = new ListCompositor<int>();
Assert.Throws<ArgumentOutOfRangeException>(() => compositor.ToList(-1));
Assert.Throws<ArgumentOutOfRangeException>(() => compositor.ToList(1));
compositor.AddSource(new List<int>() { 3, 4, 5, 6, 7, 8 }, 0.3);
compositor.AddSource([3, 4, 5, 6, 7, 8], 0.3);
Assert.Throws<ArgumentOutOfRangeException>(() => compositor.ToList(13));
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Vocup.UnitTests/SettingsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public async Task TestSettings()
string basename = "vocup_settings";

VersionedSettingsLoader<VocupSettings> loader = new(directory, basename);
VersionedSettings<VocupSettings> settings = await loader.LoadAsync().ConfigureAwait(false);
VersionedSettings<VocupSettings> settings = await loader.LoadAsync();

settings.Value.StartupCounter++;
await settings.DisposeAsync();
Expand Down
2 changes: 1 addition & 1 deletion tests/Vocup.UnitTests/Vocup.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down

0 comments on commit f8fe8ef

Please sign in to comment.