Browse Source

Merge branch 'master' into fixes/Issue_6100

pull/6151/head
Max Katz 5 years ago
committed by GitHub
parent
commit
6e45368408
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/Avalonia.Controls.DataGrid/DataGridRows.cs
  2. 6
      src/Avalonia.Controls/GridLength.cs
  3. 2
      src/Avalonia.Controls/Presenters/ScrollContentPresenter.cs
  4. 8
      src/Avalonia.Controls/RowDefinitions.cs
  5. 41
      src/Avalonia.Visuals/Media/BoxShadow.cs
  6. 20
      src/Avalonia.Visuals/Media/BoxShadows.cs

2
src/Avalonia.Controls.DataGrid/DataGridRows.cs

@ -425,7 +425,7 @@ namespace Avalonia.Controls
UpdateDisplayedRows(DisplayData.FirstScrollingSlot, CellsHeight); UpdateDisplayedRows(DisplayData.FirstScrollingSlot, CellsHeight);
} }
if (DisplayData.FirstScrollingSlot < slot && DisplayData.LastScrollingSlot > slot) if (DisplayData.FirstScrollingSlot < slot && (DisplayData.LastScrollingSlot > slot || DisplayData.LastScrollingSlot == -1))
{ {
// The row is already displayed in its entirety // The row is already displayed in its entirety
return true; return true;

6
src/Avalonia.Controls/GridLength.cs

@ -77,6 +77,12 @@ namespace Avalonia.Controls
/// </summary> /// </summary>
public static GridLength Auto => new GridLength(0, GridUnitType.Auto); public static GridLength Auto => new GridLength(0, GridUnitType.Auto);
/// <summary>
/// Gets an instance of <see cref="GridLength"/> that indicates that a row or column should
/// fill its content.
/// </summary>
public static GridLength Star => new GridLength(1, GridUnitType.Star);
/// <summary> /// <summary>
/// Gets the unit of the <see cref="GridLength"/>. /// Gets the unit of the <see cref="GridLength"/>.
/// </summary> /// </summary>

2
src/Avalonia.Controls/Presenters/ScrollContentPresenter.cs

@ -511,8 +511,8 @@ namespace Avalonia.Controls.Presenters
else if (scrollable.IsLogicalScrollEnabled) else if (scrollable.IsLogicalScrollEnabled)
{ {
Viewport = scrollable.Viewport; Viewport = scrollable.Viewport;
Extent = scrollable.Extent;
Offset = scrollable.Offset; Offset = scrollable.Offset;
Extent = scrollable.Extent;
} }
} }

8
src/Avalonia.Controls/RowDefinitions.cs

@ -1,5 +1,4 @@
using System.Linq; using System.Linq;
using Avalonia.Collections;
namespace Avalonia.Controls namespace Avalonia.Controls
{ {
@ -25,6 +24,11 @@ namespace Avalonia.Controls
AddRange(GridLength.ParseLengths(s).Select(x => new RowDefinition(x))); AddRange(GridLength.ParseLengths(s).Select(x => new RowDefinition(x)));
} }
public override string ToString()
{
return string.Join(",", this.Select(x => x.Height));
}
/// <summary> /// <summary>
/// Parses a string representation of row definitions collection. /// Parses a string representation of row definitions collection.
/// </summary> /// </summary>
@ -32,4 +36,4 @@ namespace Avalonia.Controls
/// <returns>The <see cref="RowDefinitions"/>.</returns> /// <returns>The <see cref="RowDefinitions"/>.</returns>
public static RowDefinitions Parse(string s) => new RowDefinitions(s); public static RowDefinitions Parse(string s) => new RowDefinitions(s);
} }
} }

41
src/Avalonia.Visuals/Media/BoxShadow.cs

@ -1,5 +1,6 @@
using System; using System;
using System.Globalization; using System.Globalization;
using System.Text;
using Avalonia.Animation.Animators; using Avalonia.Animation.Animators;
using Avalonia.Utilities; using Avalonia.Utilities;
@ -75,6 +76,46 @@ namespace Avalonia.Media
return rv; return rv;
} }
} }
public override string ToString()
{
var sb = new StringBuilder();
if (IsEmpty)
{
return "none";
}
if (IsInset)
{
sb.Append("inset");
}
if (OffsetX != 0.0)
{
sb.AppendFormat(" {0}", OffsetX.ToString());
}
if (OffsetY != 0.0)
{
sb.AppendFormat(" {0}", OffsetY.ToString());
}
if (Blur != 0.0)
{
sb.AppendFormat(" {0}", Blur.ToString());
}
if (Spread != 0.0)
{
sb.AppendFormat(" {0}", Spread.ToString());
}
sb.AppendFormat(" {0}", Color.ToString());
return sb.ToString();
}
public static unsafe BoxShadow Parse(string s) public static unsafe BoxShadow Parse(string s)
{ {
if(s == null) if(s == null)

20
src/Avalonia.Visuals/Media/BoxShadows.cs

@ -1,6 +1,6 @@
using System; using System;
using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Text;
using Avalonia.Animation.Animators; using Avalonia.Animation.Animators;
namespace Avalonia.Media namespace Avalonia.Media
@ -43,6 +43,24 @@ namespace Avalonia.Media
} }
} }
public override string ToString()
{
var sb = new StringBuilder();
if (Count == 0)
{
return "none";
}
foreach (var boxShadow in this)
{
sb.AppendFormat("{0} ", boxShadow.ToString());
}
return sb.ToString();
}
[EditorBrowsable(EditorBrowsableState.Never)] [EditorBrowsable(EditorBrowsableState.Never)]
public struct BoxShadowsEnumerator public struct BoxShadowsEnumerator
{ {

Loading…
Cancel
Save