From 012224d29805de96dc14162aa36a486ab5cf0709 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Fri, 28 Aug 2020 08:01:10 +0200 Subject: [PATCH 1/6] Don't display vertical grid lines by default. --- src/Avalonia.Controls.DataGrid/Themes/Default.xaml | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Avalonia.Controls.DataGrid/Themes/Default.xaml b/src/Avalonia.Controls.DataGrid/Themes/Default.xaml index 93e18548ce..cf062e0920 100644 --- a/src/Avalonia.Controls.DataGrid/Themes/Default.xaml +++ b/src/Avalonia.Controls.DataGrid/Themes/Default.xaml @@ -201,7 +201,6 @@ - From 7516eeaf927c30149091f65d33546b77290207e9 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Fri, 28 Aug 2020 08:44:14 +0200 Subject: [PATCH 2/6] Prevent duplicate properties in DevTools. Properties can be registered on a control as both normal properties and attached properties. --- .../Diagnostics/ViewModels/ControlDetailsViewModel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Avalonia.Diagnostics/Diagnostics/ViewModels/ControlDetailsViewModel.cs b/src/Avalonia.Diagnostics/Diagnostics/ViewModels/ControlDetailsViewModel.cs index 4e7129da41..915ba9eeee 100644 --- a/src/Avalonia.Diagnostics/Diagnostics/ViewModels/ControlDetailsViewModel.cs +++ b/src/Avalonia.Diagnostics/Diagnostics/ViewModels/ControlDetailsViewModel.cs @@ -81,7 +81,7 @@ namespace Avalonia.Diagnostics.ViewModels if (o is AvaloniaObject ao) { return AvaloniaPropertyRegistry.Instance.GetRegistered(ao) - .Concat(AvaloniaPropertyRegistry.Instance.GetRegisteredAttached(ao.GetType())) + .Union(AvaloniaPropertyRegistry.Instance.GetRegisteredAttached(ao.GetType())) .Select(x => new AvaloniaPropertyViewModel(ao, x)); } else From 5580e0f54b107afd3b216966626cdce115e75c37 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Fri, 28 Aug 2020 11:01:05 +0100 Subject: [PATCH 3/6] add failing unit test. --- .../ToolTipTests.cs | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tests/Avalonia.Controls.UnitTests/ToolTipTests.cs b/tests/Avalonia.Controls.UnitTests/ToolTipTests.cs index e52e7a487b..9279e78013 100644 --- a/tests/Avalonia.Controls.UnitTests/ToolTipTests.cs +++ b/tests/Avalonia.Controls.UnitTests/ToolTipTests.cs @@ -124,6 +124,35 @@ namespace Avalonia.Controls.UnitTests Assert.True(ToolTip.GetIsOpen(target)); } } + + [Fact] + public void Content_Should_Update_When_Tip_Property_Changes_And_Already_Open() + { + using (UnitTestApplication.Start(TestServices.StyledWindow)) + { + var window = new Window(); + + var target = new Decorator() + { + [ToolTip.TipProperty] = "Tip", + [ToolTip.ShowDelayProperty] = 0 + }; + + window.Content = target; + + window.ApplyTemplate(); + window.Presenter.ApplyTemplate(); + + _mouseHelper.Enter(target); + + Assert.True(ToolTip.GetIsOpen(target)); + Assert.Equal("Tip", target.GetValue(ToolTip.ToolTipProperty).Content); + + + ToolTip.SetTip(target, "Tip1"); + Assert.Equal("Tip1", target.GetValue(ToolTip.ToolTipProperty).Content); + } + } [Fact] public void Should_Open_On_Pointer_Enter_With_Delay() From 3c369153c25d3b18aaf7e5c6a3852d982097a477 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Fri, 28 Aug 2020 11:01:48 +0100 Subject: [PATCH 4/6] update tooltip content when already opened and tip changes. --- src/Avalonia.Controls/ToolTip.cs | 2 +- src/Avalonia.Controls/ToolTipService.cs | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Avalonia.Controls/ToolTip.cs b/src/Avalonia.Controls/ToolTip.cs index cf0652247f..d56ff5752f 100644 --- a/src/Avalonia.Controls/ToolTip.cs +++ b/src/Avalonia.Controls/ToolTip.cs @@ -55,7 +55,7 @@ namespace Avalonia.Controls /// /// Stores the current instance in the control. /// - private static readonly AttachedProperty ToolTipProperty = + internal static readonly AttachedProperty ToolTipProperty = AvaloniaProperty.RegisterAttached("ToolTip"); private IPopupHost _popup; diff --git a/src/Avalonia.Controls/ToolTipService.cs b/src/Avalonia.Controls/ToolTipService.cs index e2a0f9e50c..92d2e7cbfe 100644 --- a/src/Avalonia.Controls/ToolTipService.cs +++ b/src/Avalonia.Controls/ToolTipService.cs @@ -35,6 +35,13 @@ namespace Avalonia.Controls control.PointerEnter += ControlPointerEnter; control.PointerLeave += ControlPointerLeave; } + + if (e.NewValue != e.OldValue && ToolTip.GetIsOpen(control)) + { + var tip = control.GetValue(ToolTip.ToolTipProperty); + + tip.Content = e.NewValue; + } } internal void TipOpenChanged(AvaloniaPropertyChangedEventArgs e) From 03a1eae221cfee2d941f197bd43b142c4f19e491 Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Fri, 28 Aug 2020 18:10:25 +0100 Subject: [PATCH 5/6] just check newvalue isnt tooltip. --- src/Avalonia.Controls/ToolTipService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Avalonia.Controls/ToolTipService.cs b/src/Avalonia.Controls/ToolTipService.cs index 92d2e7cbfe..341ab2fe81 100644 --- a/src/Avalonia.Controls/ToolTipService.cs +++ b/src/Avalonia.Controls/ToolTipService.cs @@ -36,7 +36,7 @@ namespace Avalonia.Controls control.PointerLeave += ControlPointerLeave; } - if (e.NewValue != e.OldValue && ToolTip.GetIsOpen(control)) + if (ToolTip.GetIsOpen(control) && e.NewValue != e.OldValue && !(e.NewValue is ToolTip)) { var tip = control.GetValue(ToolTip.ToolTipProperty); From b16d4bfa3b8a9d9756df826b602ca5fa24e80a8e Mon Sep 17 00:00:00 2001 From: Jumar Macato Date: Sat, 29 Aug 2020 01:14:44 +0800 Subject: [PATCH 6/6] fix innerL/R contents scrolling with text --- src/Avalonia.Themes.Default/TextBox.xaml | 59 ++++++++++++------------ 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/src/Avalonia.Themes.Default/TextBox.xaml b/src/Avalonia.Themes.Default/TextBox.xaml index c24f13dc69..9085cfc2c6 100644 --- a/src/Avalonia.Themes.Default/TextBox.xaml +++ b/src/Avalonia.Themes.Default/TextBox.xaml @@ -45,34 +45,35 @@ - - - - - - - - - + + + + + + + + + + + @@ -129,7 +130,7 @@