diff --git a/Avalonia.sln b/Avalonia.sln index 75f1dd8407..6c3c3a92b9 100644 --- a/Avalonia.sln +++ b/Avalonia.sln @@ -222,8 +222,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Headless.Vnc", "sr EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Markup.Xaml.Loader", "src\Markup\Avalonia.Markup.Xaml.Loader\Avalonia.Markup.Xaml.Loader.csproj", "{909A8CBD-7D0E-42FD-B841-022AD8925820}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.ReactiveUI.Events", "src\Avalonia.ReactiveUI.Events\Avalonia.ReactiveUI.Events.csproj", "{28F18757-C3E6-4BBE-A37D-11BA2AB9177C}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sandbox", "samples\Sandbox\Sandbox.csproj", "{11BE52AF-E2DD-4CF0-B19A-05285ACAF571}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MicroComGenerator", "src\tools\MicroComGenerator\MicroComGenerator.csproj", "{AEC9031E-06EA-4A9E-9E7F-7D7C719404DD}" diff --git a/nukebuild/Build.cs b/nukebuild/Build.cs index eec21d4423..6f4afd9191 100644 --- a/nukebuild/Build.cs +++ b/nukebuild/Build.cs @@ -16,7 +16,6 @@ using Nuke.Common.Tools.MSBuild; using Nuke.Common.Tools.Npm; using Nuke.Common.Utilities; using Nuke.Common.Utilities.Collections; -using Pharmacist.Core; using static Nuke.Common.EnvironmentInfo; using static Nuke.Common.IO.FileSystemTasks; using static Nuke.Common.IO.PathConstruction; @@ -163,44 +162,8 @@ partial class Build : NukeBuild .AddProperty("PackageVersion", Parameters.Version) .SetConfiguration(Parameters.Configuration) ); - - await CompileReactiveEvents(); }); - async Task CompileReactiveEvents() - { - var avaloniaBuildOutput = Path.Combine(RootDirectory, "packages", "Avalonia", "bin", Parameters.Configuration); - var avaloniaAssemblies = GlobFiles(avaloniaBuildOutput, "**/Avalonia*.dll") - .Where(file => !file.Contains("Avalonia.Build.Tasks") && - !file.Contains("Avalonia.Remote.Protocol")); - - var eventsDirectory = GlobDirectories($"{RootDirectory}/src/**/Avalonia.ReactiveUI.Events").First(); - var eventsBuildFile = Path.Combine(eventsDirectory, "Events_Avalonia.cs"); - if (File.Exists(eventsBuildFile)) - File.Delete(eventsBuildFile); - - using (var stream = File.Create(eventsBuildFile)) - using (var writer = new StreamWriter(stream)) - { - await ObservablesForEventGenerator.ExtractEventsFromAssemblies( - writer, avaloniaAssemblies, new string[0], "netstandard2.0" - ); - } - - var eventsProject = Path.Combine(eventsDirectory, "Avalonia.ReactiveUI.Events.csproj"); - if (Parameters.IsRunningOnWindows) - MsBuildCommon(eventsProject, c => c - .SetProcessArgumentConfigurator(a => a.Add("/r")) - .AddTargets("Build") - ); - else - DotNetBuild(c => c - .SetProjectFile(eventsProject) - .AddProperty("PackageVersion", Parameters.Version) - .SetConfiguration(Parameters.Configuration) - ); - } - void RunCoreTest(string projectName) { Information($"Running tests from {projectName}"); diff --git a/nukebuild/_build.csproj b/nukebuild/_build.csproj index b0380cc92b..e08ffd0413 100644 --- a/nukebuild/_build.csproj +++ b/nukebuild/_build.csproj @@ -17,7 +17,6 @@ - diff --git a/src/Avalonia.Controls.DataGrid/Themes/Fluent.xaml b/src/Avalonia.Controls.DataGrid/Themes/Fluent.xaml index 998198cc1c..0c4f8249ce 100644 --- a/src/Avalonia.Controls.DataGrid/Themes/Fluent.xaml +++ b/src/Avalonia.Controls.DataGrid/Themes/Fluent.xaml @@ -163,6 +163,10 @@ + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Avalonia.Dialogs/ResourceSelectorConverter.cs b/src/Avalonia.Dialogs/ResourceSelectorConverter.cs index 9d8b6cb1c7..c8226b98e4 100644 --- a/src/Avalonia.Dialogs/ResourceSelectorConverter.cs +++ b/src/Avalonia.Dialogs/ResourceSelectorConverter.cs @@ -5,7 +5,7 @@ using Avalonia.Data.Converters; namespace Avalonia.Dialogs { - internal class ResourceSelectorConverter : ResourceDictionary, IValueConverter + public class ResourceSelectorConverter : ResourceDictionary, IValueConverter { public object Convert(object key, Type targetType, object parameter, CultureInfo culture) { diff --git a/src/Avalonia.ReactiveUI.Events/Avalonia.ReactiveUI.Events.csproj b/src/Avalonia.ReactiveUI.Events/Avalonia.ReactiveUI.Events.csproj deleted file mode 100644 index 7f58e455f9..0000000000 --- a/src/Avalonia.ReactiveUI.Events/Avalonia.ReactiveUI.Events.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - netstandard2.0 - Avalonia.ReactiveUI.Events - false - - - - - - - - diff --git a/src/Avalonia.Themes.Default/Avalonia.Themes.Default.csproj b/src/Avalonia.Themes.Default/Avalonia.Themes.Default.csproj index 153e21761e..06859e0cbb 100644 --- a/src/Avalonia.Themes.Default/Avalonia.Themes.Default.csproj +++ b/src/Avalonia.Themes.Default/Avalonia.Themes.Default.csproj @@ -12,6 +12,7 @@ + diff --git a/src/Avalonia.Themes.Default/DefaultTheme.xaml b/src/Avalonia.Themes.Default/DefaultTheme.xaml index 4ae9ea4812..109fde390c 100644 --- a/src/Avalonia.Themes.Default/DefaultTheme.xaml +++ b/src/Avalonia.Themes.Default/DefaultTheme.xaml @@ -62,4 +62,5 @@ + diff --git a/src/Avalonia.Themes.Default/ManagedFileChooser.xaml b/src/Avalonia.Themes.Default/ManagedFileChooser.xaml new file mode 100644 index 0000000000..f9f77bf455 --- /dev/null +++ b/src/Avalonia.Themes.Default/ManagedFileChooser.xaml @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Avalonia.Themes.Fluent/Avalonia.Themes.Fluent.csproj b/src/Avalonia.Themes.Fluent/Avalonia.Themes.Fluent.csproj index 72f1fbf973..d0bc8e9d26 100644 --- a/src/Avalonia.Themes.Fluent/Avalonia.Themes.Fluent.csproj +++ b/src/Avalonia.Themes.Fluent/Avalonia.Themes.Fluent.csproj @@ -11,7 +11,8 @@ - + + diff --git a/src/Avalonia.Themes.Fluent/Controls/DataValidationErrors.xaml b/src/Avalonia.Themes.Fluent/Controls/DataValidationErrors.xaml index f83af266c2..b513fd5eae 100644 --- a/src/Avalonia.Themes.Fluent/Controls/DataValidationErrors.xaml +++ b/src/Avalonia.Themes.Fluent/Controls/DataValidationErrors.xaml @@ -1,44 +1,102 @@ - + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Avalonia.Themes.Fluent/Controls/FluentControls.xaml b/src/Avalonia.Themes.Fluent/Controls/FluentControls.xaml index 16e05ffdfd..51836255ef 100644 --- a/src/Avalonia.Themes.Fluent/Controls/FluentControls.xaml +++ b/src/Avalonia.Themes.Fluent/Controls/FluentControls.xaml @@ -61,4 +61,6 @@ + + diff --git a/src/Avalonia.Themes.Fluent/Controls/ManagedFileChooser.xaml b/src/Avalonia.Themes.Fluent/Controls/ManagedFileChooser.xaml new file mode 100644 index 0000000000..7ba5440591 --- /dev/null +++ b/src/Avalonia.Themes.Fluent/Controls/ManagedFileChooser.xaml @@ -0,0 +1,324 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Skia/Avalonia.Skia/TextShaperImpl.cs b/src/Skia/Avalonia.Skia/TextShaperImpl.cs index 31724bfee9..5cf72e2ce8 100644 --- a/src/Skia/Avalonia.Skia/TextShaperImpl.cs +++ b/src/Skia/Avalonia.Skia/TextShaperImpl.cs @@ -87,7 +87,7 @@ namespace Avalonia.Skia { var nextCodepoint = Codepoint.ReadAt(text, i + 1, out _); - if (nextCodepoint == '\r' && codepoint == '\n' || nextCodepoint == '\n' && codepoint == '\r') + if (nextCodepoint == '\n' && codepoint == '\r') { count++; diff --git a/tests/Avalonia.Skia.UnitTests/Media/TextFormatting/TextShaperTests.cs b/tests/Avalonia.Skia.UnitTests/Media/TextFormatting/TextShaperTests.cs new file mode 100644 index 0000000000..62d2c54ffe --- /dev/null +++ b/tests/Avalonia.Skia.UnitTests/Media/TextFormatting/TextShaperTests.cs @@ -0,0 +1,43 @@ +using System; +using System.Globalization; +using Avalonia.Media; +using Avalonia.Media.TextFormatting; +using Avalonia.UnitTests; +using Xunit; + +namespace Avalonia.Skia.UnitTests.Media.TextFormatting +{ + public class TextShaperTests + { + [Fact] + public void Should_Form_Clusters_For_BreakPairs() + { + using (Start()) + { + var text = "\n\r\n".AsMemory(); + + var glyphRun = TextShaper.Current.ShapeText( + text, + Typeface.Default, + 12, + CultureInfo.CurrentCulture); + + Assert.Equal(glyphRun.Characters.Length, text.Length); + Assert.Equal(glyphRun.GlyphClusters.Length, text.Length); + Assert.Equal(0, glyphRun.GlyphClusters[0]); + Assert.Equal(1, glyphRun.GlyphClusters[1]); + Assert.Equal(1, glyphRun.GlyphClusters[2]); + } + } + + private static IDisposable Start() + { + var disposable = UnitTestApplication.Start(TestServices.MockPlatformRenderInterface + .With(renderInterface: new PlatformRenderInterface(null), + textShaperImpl: new TextShaperImpl(), + fontManagerImpl: new CustomFontManagerImpl())); + + return disposable; + } + } +}