Browse Source

Merge branch 'master' into fixes/fix-progressbar-vertical-templat

pull/4362/head
danwalmsley 6 years ago
committed by GitHub
parent
commit
dd971e417c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      build/SkiaSharp.props
  2. 2
      src/Avalonia.Build.Tasks/XamlCompilerTaskExecutor.cs
  3. 11
      src/Avalonia.Native/AvaloniaNativeMenuExporter.cs
  4. 4
      src/Avalonia.Themes.Default/TitleBar.xaml
  5. 9
      src/Avalonia.Themes.Default/Window.xaml
  6. 4
      src/Avalonia.Visuals/ApiCompatBaseline.txt
  7. 8
      src/Avalonia.Visuals/Media/FontStyle.cs
  8. 5
      src/Avalonia.Visuals/Media/RadialGradientBrush.cs
  9. 2
      src/Markup/Avalonia.Markup.Xaml.Loader/xamlil.github
  10. 3
      src/Skia/Avalonia.Skia/SKTypefaceCollectionCache.cs
  11. 11
      src/Skia/Avalonia.Skia/SkiaSharpExtensions.cs

2
build/SkiaSharp.props

@ -1,6 +1,6 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="SkiaSharp" Version="2.80.0" />
<PackageReference Include="SkiaSharp" Version="2.80.1" />
<PackageReference Condition="'$(IncludeLinuxSkia)' == 'true'" Include="SkiaSharp.NativeAssets.Linux" Version="2.80.0" />
</ItemGroup>
</Project>

2
src/Avalonia.Build.Tasks/XamlCompilerTaskExecutor.cs

@ -128,7 +128,7 @@ namespace Avalonia.Build.Tasks
asm.MainModule.Types.Add(typeDef);
var builder = typeSystem.CreateTypeBuilder(typeDef);
foreach (var res in group.Resources.Where(CheckXamlName))
foreach (var res in group.Resources.Where(CheckXamlName).OrderBy(x=>x.FilePath.ToLowerInvariant()))
{
try
{

11
src/Avalonia.Native/AvaloniaNativeMenuExporter.cs

@ -11,7 +11,7 @@ namespace Avalonia.Native
class AvaloniaNativeMenuExporter : ITopLevelNativeMenuExporter
{
private IAvaloniaNativeFactory _factory;
private bool _resetQueued;
private bool _resetQueued = true;
private bool _exported = false;
private IAvnWindow _nativeWindow;
private NativeMenu _menu;
@ -39,8 +39,7 @@ namespace Avalonia.Native
public void SetNativeMenu(NativeMenu menu)
{
_menu = menu == null ? new NativeMenu() : menu;
DoLayoutReset();
DoLayoutReset(true);
}
internal void UpdateIfNeeded()
@ -74,9 +73,9 @@ namespace Avalonia.Native
return result;
}
private void DoLayoutReset()
private void DoLayoutReset(bool forceUpdate = false)
{
if (_resetQueued)
if (_resetQueued || forceUpdate)
{
_resetQueued = false;
@ -109,7 +108,7 @@ namespace Avalonia.Native
if (_resetQueued)
return;
_resetQueued = true;
Dispatcher.UIThread.Post(DoLayoutReset, DispatcherPriority.Background);
Dispatcher.UIThread.Post(() => DoLayoutReset(), DispatcherPriority.Background);
}
private void SetMenu(NativeMenu menu)

4
src/Avalonia.Themes.Default/TitleBar.xaml

@ -5,7 +5,7 @@
</Border>
</Design.PreviewWith>
<Style Selector="TitleBar">
<Setter Property="Foreground" Value="{DynamicResource SystemControlForegroundBaseHighBrush}"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeForegroundBrush}"/>
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="Background" Value="Transparent" />
@ -23,7 +23,7 @@
</Style>
<Style Selector="TitleBar:fullscreen">
<Setter Property="Background" Value="{DynamicResource SystemAccentColor}" />
<Setter Property="Background" Value="{DynamicResource ThemeAccentColor}" />
</Style>
<Style Selector="TitleBar /template/ Border#PART_Background">

9
src/Avalonia.Themes.Default/Window.xaml

@ -1,9 +1,8 @@
<Style xmlns="https://github.com/avaloniaui" Selector="Window">
<Setter Property="Background" Value="{DynamicResource SystemControlBackgroundAltHighBrush}"/>
<Setter Property="TransparencyBackgroundFallback" Value="{DynamicResource SystemControlBackgroundAltHighBrush}" />
<Setter Property="Foreground" Value="{DynamicResource SystemControlForegroundBaseHighBrush}"/>
<Setter Property="FontSize" Value="{DynamicResource ContentControlFontSize}"/>
<Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" />
<Setter Property="Background" Value="{DynamicResource ThemeBackgroundBrush}"/>
<Setter Property="TransparencyBackgroundFallback" Value="{DynamicResource HighlightForegroundColor}" />
<Setter Property="Foreground" Value="{DynamicResource ThemeForegroundBrush}"/>
<Setter Property="FontSize" Value="{DynamicResource FontSizeSmall}"/>
<Setter Property="Template">
<ControlTemplate>
<Panel>

4
src/Avalonia.Visuals/ApiCompatBaseline.txt

@ -0,0 +1,4 @@
Compat issues with assembly Avalonia.Visuals:
EnumValuesMustMatch : Enum value 'Avalonia.Media.FontStyle Avalonia.Media.FontStyle.Italic' is (System.Int32)1 in the implementation but (System.Int32)2 in the contract.
EnumValuesMustMatch : Enum value 'Avalonia.Media.FontStyle Avalonia.Media.FontStyle.Oblique' is (System.Int32)2 in the implementation but (System.Int32)1 in the contract.
Total Issues: 2

8
src/Avalonia.Visuals/Media/FontStyle.cs

@ -11,13 +11,13 @@ namespace Avalonia.Media
Normal,
/// <summary>
/// An oblique font.
/// An italic font.
/// </summary>
Oblique,
Italic,
/// <summary>
/// An italic font.
/// An oblique font.
/// </summary>
Italic,
Oblique
}
}

5
src/Avalonia.Visuals/Media/RadialGradientBrush.cs

@ -30,6 +30,11 @@ namespace Avalonia.Media
AvaloniaProperty.Register<RadialGradientBrush, double>(
nameof(Radius),
0.5);
static RadialGradientBrush()
{
AffectsRender<RadialGradientBrush>(CenterProperty, GradientOriginProperty, RadiusProperty);
}
/// <summary>
/// Gets or sets the start point for the gradient.

2
src/Markup/Avalonia.Markup.Xaml.Loader/xamlil.github

@ -1 +1 @@
Subproject commit 8d9fee734afaced9366774fda41b6aa2ab19875f
Subproject commit 7d15a9227461cf4d62bc2ed251fcc25c96b28aaf

3
src/Skia/Avalonia.Skia/SKTypefaceCollectionCache.cs

@ -56,7 +56,8 @@ namespace Avalonia.Skia
continue;
}
var key = new FontKey(fontFamily.Name, (FontStyle)typeface.FontSlant, (FontWeight)typeface.FontWeight);
var key = new FontKey(fontFamily.Name, typeface.FontSlant.ToAvalonia(),
(FontWeight)typeface.FontWeight);
typeFaceCollection.AddTypeface(key, typeface);
}

11
src/Skia/Avalonia.Skia/SkiaSharpExtensions.cs

@ -138,6 +138,17 @@ namespace Avalonia.Skia
}
}
public static FontStyle ToAvalonia(this SKFontStyleSlant slant)
{
return slant switch
{
SKFontStyleSlant.Upright => FontStyle.Normal,
SKFontStyleSlant.Italic => FontStyle.Italic,
SKFontStyleSlant.Oblique => FontStyle.Oblique,
_ => throw new ArgumentOutOfRangeException(nameof (slant), slant, null)
};
}
public static SKPath Clone(this SKPath src)
{
return src != null ? new SKPath(src) : null;

Loading…
Cancel
Save