Browse Source
Merge branch 'master' into opt-empty-value-store
pull/5074/head
Dariusz Komosiński
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
20 additions and
2 deletions
-
src/Avalonia.Themes.Default/ToggleSwitch.xaml
-
src/Avalonia.Themes.Fluent/ToggleSwitch.xaml
-
src/Markup/Avalonia.Markup.Xaml.Loader/CompilerExtensions/AvaloniaXamlIlLanguage.cs
-
src/Markup/Avalonia.Markup.Xaml.Loader/CompilerExtensions/Transformers/AvaloniaXamlIlWellKnownTypes.cs
|
|
|
@ -5,7 +5,7 @@ |
|
|
|
<Thickness x:Key="ToggleSwitchTopHeaderMargin">0,0,0,6</Thickness> |
|
|
|
<GridLength x:Key="ToggleSwitchPreContentMargin">6</GridLength> |
|
|
|
<GridLength x:Key="ToggleSwitchPostContentMargin">6</GridLength> |
|
|
|
<x:Double x:Key="ToggleSwitchThemeMinWidth">154</x:Double> |
|
|
|
<x:Double x:Key="ToggleSwitchThemeMinWidth">0</x:Double> |
|
|
|
<Thickness x:Key="ToggleSwitchOnStrokeThickness">0</Thickness> |
|
|
|
<Thickness x:Key="ToggleSwitchOuterBorderStrokeThickness">1</Thickness> |
|
|
|
<SolidColorBrush x:Key="ToggleSwitchContentForeground" Color="{DynamicResource ThemeForegroundColor}" /> |
|
|
|
|
|
|
|
@ -5,7 +5,7 @@ |
|
|
|
<Thickness x:Key="ToggleSwitchTopHeaderMargin">0,0,0,6</Thickness> |
|
|
|
<GridLength x:Key="ToggleSwitchPreContentMargin">6</GridLength> |
|
|
|
<GridLength x:Key="ToggleSwitchPostContentMargin">6</GridLength> |
|
|
|
<x:Double x:Key="ToggleSwitchThemeMinWidth">154</x:Double> |
|
|
|
<x:Double x:Key="ToggleSwitchThemeMinWidth">0</x:Double> |
|
|
|
</Styles.Resources> |
|
|
|
<Design.PreviewWith> |
|
|
|
<StackPanel Margin="20" Width="250" Spacing="24" > |
|
|
|
|
|
|
|
@ -341,6 +341,18 @@ namespace Avalonia.Markup.Xaml.XamlIl.CompilerExtensions |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (type.Equals(types.Cursor)) |
|
|
|
{ |
|
|
|
if (TypeSystemHelpers.TryGetEnumValueNode(types.StandardCursorType, text, node, out var enumConstantNode)) |
|
|
|
{ |
|
|
|
var cursorTypeRef = new XamlAstClrTypeReference(node, types.Cursor, false); |
|
|
|
|
|
|
|
result = new XamlAstNewClrObjectNode(node, cursorTypeRef, types.CursorTypeConstructor, new List<IXamlAstValueNode> { enumConstantNode }); |
|
|
|
|
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (type.FullName == "Avalonia.AvaloniaProperty") |
|
|
|
{ |
|
|
|
var scope = context.ParentNodes().OfType<AvaloniaXamlIlTargetTypeMetadataNode>().FirstOrDefault(); |
|
|
|
|
|
|
|
@ -69,6 +69,9 @@ namespace Avalonia.Markup.Xaml.XamlIl.CompilerExtensions.Transformers |
|
|
|
public IXamlType GridLength { get; } |
|
|
|
public IXamlConstructor GridLengthConstructorValueType { get; } |
|
|
|
public IXamlType Color { get; } |
|
|
|
public IXamlType StandardCursorType { get; } |
|
|
|
public IXamlType Cursor { get; } |
|
|
|
public IXamlConstructor CursorTypeConstructor { get; } |
|
|
|
|
|
|
|
public AvaloniaXamlIlWellKnownTypes(TransformerConfiguration cfg) |
|
|
|
{ |
|
|
|
@ -150,6 +153,9 @@ namespace Avalonia.Markup.Xaml.XamlIl.CompilerExtensions.Transformers |
|
|
|
GridLength = cfg.TypeSystem.GetType("Avalonia.Controls.GridLength"); |
|
|
|
GridLengthConstructorValueType = GridLength.GetConstructor(new List<IXamlType> { XamlIlTypes.Double, cfg.TypeSystem.GetType("Avalonia.Controls.GridUnitType") }); |
|
|
|
Color = cfg.TypeSystem.GetType("Avalonia.Media.Color"); |
|
|
|
StandardCursorType = cfg.TypeSystem.GetType("Avalonia.Input.StandardCursorType"); |
|
|
|
Cursor = cfg.TypeSystem.GetType("Avalonia.Input.Cursor"); |
|
|
|
CursorTypeConstructor = Cursor.GetConstructor(new List<IXamlType> { StandardCursorType }); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|