Browse Source
Merge branch 'master' into control-validation-message-fix
pull/4704/head
Benedikt Stebner
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with
88 additions and
6 deletions
-
src/Avalonia.Themes.Default/PathIcon.xaml
-
src/Avalonia.Themes.Fluent/PathIcon.xaml
-
src/Avalonia.Visuals/Point.cs
-
src/Avalonia.Visuals/Size.cs
-
src/Avalonia.Visuals/Thickness.cs
-
src/Avalonia.Visuals/Vector.cs
|
|
|
@ -2,14 +2,15 @@ |
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|
|
|
<Style Selector="PathIcon"> |
|
|
|
<Setter Property="Foreground" Value="{DynamicResource ThemeForegroundColor}" /> |
|
|
|
<Setter Property="Height" Value="16" /> |
|
|
|
<Setter Property="Width" Value="16" /> |
|
|
|
<Setter Property="Height" Value="{DynamicResource IconElementThemeHeight}" /> |
|
|
|
<Setter Property="Width" Value="{DynamicResource IconElementThemeWidth}" /> |
|
|
|
<Setter Property="Template"> |
|
|
|
<ControlTemplate> |
|
|
|
<Viewbox Height="{TemplateBinding Height}" |
|
|
|
Width="{TemplateBinding Width}"> |
|
|
|
<Path Fill="{TemplateBinding Foreground}" |
|
|
|
Data="{TemplateBinding Data}" /> |
|
|
|
Data="{TemplateBinding Data}" |
|
|
|
Stretch="Uniform" /> |
|
|
|
</Viewbox> |
|
|
|
</ControlTemplate> |
|
|
|
</Setter> |
|
|
|
|
|
|
|
@ -10,14 +10,15 @@ |
|
|
|
</Design.PreviewWith> |
|
|
|
<Style Selector="PathIcon"> |
|
|
|
<Setter Property="Foreground" Value="{DynamicResource TextControlForeground}" /> |
|
|
|
<Setter Property="Height" Value="16" /> |
|
|
|
<Setter Property="Width" Value="16" /> |
|
|
|
<Setter Property="Height" Value="{DynamicResource IconElementThemeHeight}" /> |
|
|
|
<Setter Property="Width" Value="{DynamicResource IconElementThemeWidth}" /> |
|
|
|
<Setter Property="Template"> |
|
|
|
<ControlTemplate> |
|
|
|
<Viewbox Height="{TemplateBinding Height}" |
|
|
|
Width="{TemplateBinding Width}"> |
|
|
|
<Path Fill="{TemplateBinding Foreground}" |
|
|
|
Data="{TemplateBinding Data}" /> |
|
|
|
Data="{TemplateBinding Data}" |
|
|
|
Stretch="Uniform" /> |
|
|
|
</Viewbox> |
|
|
|
</ControlTemplate> |
|
|
|
</Setter> |
|
|
|
|
|
|
|
@ -267,5 +267,24 @@ namespace Avalonia |
|
|
|
{ |
|
|
|
return new Point(_x, y); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Deconstructs the point into its X and Y coordinates.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="x">The X coordinate.</param>
|
|
|
|
/// <param name="y">The Y coordinate.</param>
|
|
|
|
public void Deconstruct(out double x, out double y) |
|
|
|
{ |
|
|
|
x = this._x; |
|
|
|
y = this._y; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets a value indicating whether the X and Y coordinates are zero.
|
|
|
|
/// </summary>
|
|
|
|
public bool IsDefault |
|
|
|
{ |
|
|
|
get { return (_x == 0) && (_y == 0); } |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -276,5 +276,24 @@ namespace Avalonia |
|
|
|
{ |
|
|
|
return string.Format(CultureInfo.InvariantCulture, "{0}, {1}", _width, _height); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Deconstructs the size into its Width and Height values.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="width">The width.</param>
|
|
|
|
/// <param name="height">The height.</param>
|
|
|
|
public void Deconstruct(out double width, out double height) |
|
|
|
{ |
|
|
|
width = this._width; |
|
|
|
height = this._height; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets a value indicating whether the Width and Height values are zero.
|
|
|
|
/// </summary>
|
|
|
|
public bool IsDefault |
|
|
|
{ |
|
|
|
get { return (_width == 0) && (_height == 0); } |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -272,5 +272,28 @@ namespace Avalonia |
|
|
|
{ |
|
|
|
return $"{_left},{_top},{_right},{_bottom}"; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Deconstructor the thickness into its left, top, right and bottom thickness values.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="left">The thickness on the left.</param>
|
|
|
|
/// <param name="top">The thickness on the top.</param>
|
|
|
|
/// <param name="right">The thickness on the right.</param>
|
|
|
|
/// <param name="bottom">The thickness on the bottom.</param>
|
|
|
|
public void Deconstruct(out double left, out double top, out double right, out double bottom) |
|
|
|
{ |
|
|
|
left = this._left; |
|
|
|
top = this._top; |
|
|
|
right = this._right; |
|
|
|
bottom = this._bottom; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets a value indicating whether the left, top, right and bottom thickness values are zero.
|
|
|
|
/// </summary>
|
|
|
|
public bool IsDefault |
|
|
|
{ |
|
|
|
get { return (_left == 0) && (_top == 0) && (_right == 0) && (_bottom == 0); } |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -333,5 +333,24 @@ namespace Avalonia |
|
|
|
/// </summary>
|
|
|
|
public static Vector UnitY |
|
|
|
=> new Vector(0, 1); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Deconstructs the vector into its X and Y components.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="x">The X component.</param>
|
|
|
|
/// <param name="y">The Y component.</param>
|
|
|
|
public void Deconstruct(out double x, out double y) |
|
|
|
{ |
|
|
|
x = this._x; |
|
|
|
y = this._y; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets a value indicating whether the X and Y components are zero.
|
|
|
|
/// </summary>
|
|
|
|
public bool IsDefault |
|
|
|
{ |
|
|
|
get { return (_x == 0) && (_y == 0); } |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|