Browse Source
Merge branch 'master' into fixes/selecteditems-binding
pull/5817/head
Dariusz Komosiński
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
5 additions and
5 deletions
-
src/Avalonia.Controls/NativeControlHost.cs
-
src/Avalonia.Controls/ScrollViewer.cs
-
tests/Avalonia.Controls.UnitTests/ScrollViewerTests.cs
-
tests/Avalonia.Layout.UnitTests/LayoutableTests_EffectiveViewportChanged.cs
|
|
@ -120,7 +120,7 @@ namespace Avalonia.Controls |
|
|
private Rect? GetAbsoluteBounds() |
|
|
private Rect? GetAbsoluteBounds() |
|
|
{ |
|
|
{ |
|
|
var bounds = Bounds; |
|
|
var bounds = Bounds; |
|
|
var position = this.TranslatePoint(bounds.Position, _currentRoot); |
|
|
var position = this.TranslatePoint(default, _currentRoot); |
|
|
if (position == null) |
|
|
if (position == null) |
|
|
return null; |
|
|
return null; |
|
|
return new Rect(position.Value, bounds.Size); |
|
|
return new Rect(position.Value, bounds.Size); |
|
|
|
|
|
@ -120,7 +120,7 @@ namespace Avalonia.Controls |
|
|
public static readonly AttachedProperty<ScrollBarVisibility> HorizontalScrollBarVisibilityProperty = |
|
|
public static readonly AttachedProperty<ScrollBarVisibility> HorizontalScrollBarVisibilityProperty = |
|
|
AvaloniaProperty.RegisterAttached<ScrollViewer, Control, ScrollBarVisibility>( |
|
|
AvaloniaProperty.RegisterAttached<ScrollViewer, Control, ScrollBarVisibility>( |
|
|
nameof(HorizontalScrollBarVisibility), |
|
|
nameof(HorizontalScrollBarVisibility), |
|
|
ScrollBarVisibility.Hidden); |
|
|
ScrollBarVisibility.Disabled); |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// Defines the VerticalScrollBarMaximum property.
|
|
|
/// Defines the VerticalScrollBarMaximum property.
|
|
|
|
|
|
@ -37,7 +37,7 @@ namespace Avalonia.Controls.UnitTests |
|
|
target.HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled; |
|
|
target.HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled; |
|
|
target.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto; |
|
|
target.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto; |
|
|
|
|
|
|
|
|
Assert.Equal(new[] { true, false, true }, values); |
|
|
Assert.Equal(new[] { false, true }, values); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
[Fact] |
|
|
[Fact] |
|
|
|
|
|
@ -162,7 +162,7 @@ namespace Avalonia.Layout.UnitTests |
|
|
{ |
|
|
{ |
|
|
var root = CreateRoot(); |
|
|
var root = CreateRoot(); |
|
|
var target = new Canvas { Width = 200, Height = 200 }; |
|
|
var target = new Canvas { Width = 200, Height = 200 }; |
|
|
var scroller = new ScrollViewer { Width = 100, Height = 100, Content = target, Template = ScrollViewerTemplate() }; |
|
|
var scroller = new ScrollViewer { Width = 100, Height = 100, Content = target, Template = ScrollViewerTemplate(), HorizontalScrollBarVisibility = ScrollBarVisibility.Hidden }; |
|
|
var raised = 0; |
|
|
var raised = 0; |
|
|
|
|
|
|
|
|
target.EffectiveViewportChanged += (s, e) => |
|
|
target.EffectiveViewportChanged += (s, e) => |
|
|
@ -185,7 +185,7 @@ namespace Avalonia.Layout.UnitTests |
|
|
{ |
|
|
{ |
|
|
var root = CreateRoot(); |
|
|
var root = CreateRoot(); |
|
|
var target = new Canvas { Width = 200, Height = 200 }; |
|
|
var target = new Canvas { Width = 200, Height = 200 }; |
|
|
var scroller = new ScrollViewer { Width = 100, Height = 100, Content = target, Template = ScrollViewerTemplate() }; |
|
|
var scroller = new ScrollViewer { Width = 100, Height = 100, Content = target, Template = ScrollViewerTemplate(), HorizontalScrollBarVisibility = ScrollBarVisibility.Hidden }; |
|
|
var raised = 0; |
|
|
var raised = 0; |
|
|
|
|
|
|
|
|
root.Child = scroller; |
|
|
root.Child = scroller; |
|
|
|