From 1828acc05c139fc6e5a097a8f245eb85501fcbdc Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 17 Aug 2020 01:33:59 +0300 Subject: [PATCH 1/4] Changing http links to https --- readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/readme.md b/readme.md index c1bf5bbfde..ccdbbfb967 100644 --- a/readme.md +++ b/readme.md @@ -16,7 +16,7 @@ To see the status of some of our features, please see our [Roadmap](https://gith ## 🚀 Getting Started -The Avalonia [Visual Studio Extension](https://marketplace.visualstudio.com/items?itemName=AvaloniaTeam.AvaloniaforVisualStudio) contains project and control templates that will help you get started, or you can use the .NET Core CLI. For a starter guide see our [documentation](http://avaloniaui.net/docs/quickstart/create-new-project). +The Avalonia [Visual Studio Extension](https://marketplace.visualstudio.com/items?itemName=AvaloniaTeam.AvaloniaforVisualStudio) contains project and control templates that will help you get started, or you can use the .NET Core CLI. For a starter guide see our [documentation](https://avaloniaui.net/docs/quickstart/create-new-project). Avalonia is delivered via NuGet package manager. You can find the packages here: https://www.nuget.org/packages/Avalonia/ @@ -47,7 +47,7 @@ We also have a [nightly build](https://github.com/AvaloniaUI/Avalonia/wiki/Using ## Documentation -Documentation can be found on our website at http://avaloniaui.net/docs/. We also have a [tutorial](http://avaloniaui.net/docs/tutorial/) over there for newcomers. +Documentation can be found on our website at https://avaloniaui.net/docs/. We also have a [tutorial](https://avaloniaui.net/docs/tutorial/) over there for newcomers. ## Building and Using @@ -68,7 +68,7 @@ Avalonia is licenced under the [MIT licence](licence.md). ## Contributors -This project exists thanks to all the people who contribute. [[Contribute](http://avaloniaui.net/contributing)]. +This project exists thanks to all the people who contribute. [[Contribute](https://avaloniaui.net/contributing)]. ### Backers From 878012ecd01b314ed46c07eaa17f7af7d23eb3ef Mon Sep 17 00:00:00 2001 From: sdoroff Date: Thu, 20 Aug 2020 12:35:17 -0400 Subject: [PATCH 2/4] DataGridRowDetails update height Updates the height of a DataGridRowDetails when its content changes size --- src/Avalonia.Controls.DataGrid/DataGridRow.cs | 54 +++++++++++++------ 1 file changed, 39 insertions(+), 15 deletions(-) diff --git a/src/Avalonia.Controls.DataGrid/DataGridRow.cs b/src/Avalonia.Controls.DataGrid/DataGridRow.cs index d5115c983a..1d5b0c884f 100644 --- a/src/Avalonia.Controls.DataGrid/DataGridRow.cs +++ b/src/Avalonia.Controls.DataGrid/DataGridRow.cs @@ -917,23 +917,23 @@ namespace Avalonia.Controls //TODO Cleanup double? _previousDetailsHeight = null; - + //TODO Animation - private void DetailsContent_SizeChanged(Rect newValue) + private void DetailsContent_HeightChanged(double newValue) { if (_previousDetailsHeight.HasValue) { var oldValue = _previousDetailsHeight.Value; - _previousDetailsHeight = newValue.Height; - if (newValue.Height != oldValue && newValue.Height != _detailsDesiredHeight) + _previousDetailsHeight = newValue; + if (newValue != oldValue && newValue != _detailsDesiredHeight) { if (AreDetailsVisible && _appliedDetailsTemplate != null) { // Update the new desired height for RowDetails - _detailsDesiredHeight = newValue.Height; + _detailsDesiredHeight = newValue; - _detailsElement.ContentHeight = newValue.Height; + _detailsElement.ContentHeight = newValue; // Calling this when details are not visible invalidates during layout when we have no work // to do. In certain scenarios, this could cause a layout cycle @@ -943,19 +943,29 @@ namespace Avalonia.Controls } else { - _previousDetailsHeight = newValue.Height; + _previousDetailsHeight = newValue; } } - private void DetailsContent_BoundsChanged(Rect newValue) + + private void DetailsContent_SizeChanged(Rect newValue) { - if(_detailsContent != null) - DetailsContent_SizeChanged(newValue.Inflate(_detailsContent.Margin)); + DetailsContent_HeightChanged(newValue.Height); } private void DetailsContent_MarginChanged(Thickness newValue) { if (_detailsContent != null) DetailsContent_SizeChanged(_detailsContent.Bounds.Inflate(newValue)); } + private void DetailsContent_LayoutUpdated(object sender, EventArgs e) + { + if (_detailsContent != null) + { + var margin = _detailsContent.Margin; + var height = _detailsContent.DesiredSize.Height + margin.Top + margin.Bottom; + + DetailsContent_HeightChanged(height); + } + } //TODO Animation // Sets AreDetailsVisible on the row and animates if necessary @@ -1035,12 +1045,26 @@ namespace Avalonia.Controls if (_detailsContent != null) { - _detailsContentSizeSubscription = - System.Reactive.Disposables.StableCompositeDisposable.Create( - _detailsContent.GetObservable(BoundsProperty) - .Subscribe(DetailsContent_BoundsChanged), + if (_detailsContent is Layout.Layoutable layoutableContent) + { + layoutableContent.LayoutUpdated += DetailsContent_LayoutUpdated; + + _detailsContentSizeSubscription = + System.Reactive.Disposables.StableCompositeDisposable.Create( + System.Reactive.Disposables.Disposable.Create(() => layoutableContent.LayoutUpdated -= DetailsContent_LayoutUpdated), + _detailsContent.GetObservable(MarginProperty) + .Subscribe(DetailsContent_MarginChanged)); + + + } + else + { + _detailsContentSizeSubscription = _detailsContent.GetObservable(MarginProperty) - .Subscribe(DetailsContent_MarginChanged)); + .Subscribe(DetailsContent_MarginChanged); + + } + _detailsElement.Children.Add(_detailsContent); } } From a893297bc85785b2200c211386dc99b0bb58f65f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro?= Date: Tue, 18 Aug 2020 01:51:30 +0100 Subject: [PATCH 3/4] Fire Tapped only on left button click. --- src/Avalonia.Input/Gestures.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Avalonia.Input/Gestures.cs b/src/Avalonia.Input/Gestures.cs index 0efc20b196..cdfcd94692 100644 --- a/src/Avalonia.Input/Gestures.cs +++ b/src/Avalonia.Input/Gestures.cs @@ -96,8 +96,11 @@ namespace Avalonia.Input if (s_lastPress.TryGetTarget(out var target) && target == e.Source) { - var et = e.InitialPressMouseButton != MouseButton.Right ? TappedEvent : RightTappedEvent; - e.Source.RaiseEvent(new RoutedEventArgs(et)); + if (e.InitialPressMouseButton == MouseButton.Left || e.InitialPressMouseButton == MouseButton.Right) + { + var et = e.InitialPressMouseButton != MouseButton.Right ? TappedEvent : RightTappedEvent; + e.Source.RaiseEvent(new RoutedEventArgs(et)); + } } } } From 8c25848d5508e8e67b279cc804936208bc50262f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro?= Date: Thu, 20 Aug 2020 21:38:12 +0100 Subject: [PATCH 4/4] Fixed test. --- tests/Avalonia.Input.UnitTests/GesturesTests.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/Avalonia.Input.UnitTests/GesturesTests.cs b/tests/Avalonia.Input.UnitTests/GesturesTests.cs index eb930621ab..b2687c2555 100644 --- a/tests/Avalonia.Input.UnitTests/GesturesTests.cs +++ b/tests/Avalonia.Input.UnitTests/GesturesTests.cs @@ -1,10 +1,9 @@ using System.Collections.Generic; using Avalonia.Controls; -using Avalonia.Input; using Avalonia.UnitTests; using Xunit; -namespace Avalonia.Interactivity.UnitTests +namespace Avalonia.Input.UnitTests { public class GesturesTests { @@ -45,7 +44,7 @@ namespace Avalonia.Interactivity.UnitTests } [Fact] - public void Tapped_Should_Be_Raised_For_Middle_Button() + public void Tapped_Should_Not_Be_Raised_For_Middle_Button() { Border border = new Border(); var decorator = new Decorator @@ -58,7 +57,7 @@ namespace Avalonia.Interactivity.UnitTests _mouse.Click(border, MouseButton.Middle); - Assert.True(raised); + Assert.False(raised); } [Fact]