|
|
@ -10,8 +10,6 @@ namespace Avalonia.Controls |
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
public class ScrollViewer : ContentControl, IScrollable, IScrollAnchorProvider |
|
|
public class ScrollViewer : ContentControl, IScrollable, IScrollAnchorProvider |
|
|
{ |
|
|
{ |
|
|
private static readonly Size s_defaultSmallChange = new Size(16, 16); |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// Defines the <see cref="CanHorizontallyScroll"/> property.
|
|
|
/// Defines the <see cref="CanHorizontallyScroll"/> property.
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
@ -167,13 +165,15 @@ namespace Avalonia.Controls |
|
|
nameof(VerticalScrollBarVisibility), |
|
|
nameof(VerticalScrollBarVisibility), |
|
|
ScrollBarVisibility.Auto); |
|
|
ScrollBarVisibility.Auto); |
|
|
|
|
|
|
|
|
|
|
|
internal const double DefaultSmallChange = 16; |
|
|
|
|
|
|
|
|
private IDisposable _childSubscription; |
|
|
private IDisposable _childSubscription; |
|
|
private ILogicalScrollable _logicalScrollable; |
|
|
private ILogicalScrollable _logicalScrollable; |
|
|
private Size _extent; |
|
|
private Size _extent; |
|
|
private Vector _offset; |
|
|
private Vector _offset; |
|
|
private Size _viewport; |
|
|
private Size _viewport; |
|
|
private Size _largeChange; |
|
|
private Size _largeChange; |
|
|
private Size _smallChange = s_defaultSmallChange; |
|
|
private Size _smallChange = new Size(DefaultSmallChange, DefaultSmallChange); |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// Initializes static members of the <see cref="ScrollViewer"/> class.
|
|
|
/// Initializes static members of the <see cref="ScrollViewer"/> class.
|
|
|
@ -543,7 +543,7 @@ namespace Avalonia.Controls |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
SetAndRaise(SmallChangeProperty, ref _smallChange, s_defaultSmallChange); |
|
|
SetAndRaise(SmallChangeProperty, ref _smallChange, new Size(DefaultSmallChange, DefaultSmallChange)); |
|
|
SetAndRaise(LargeChangeProperty, ref _largeChange, Viewport); |
|
|
SetAndRaise(LargeChangeProperty, ref _largeChange, Viewport); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|