Browse Source
Merge branch 'master' into feature-devtool-search-regex
pull/4529/head
danwalmsley
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with
38 additions and
3 deletions
-
src/Avalonia.Controls.DataGrid/Themes/Default.xaml
-
src/Avalonia.Controls/ToolTip.cs
-
src/Avalonia.Controls/ToolTipService.cs
-
src/Avalonia.Diagnostics/Diagnostics/ViewModels/ControlDetailsViewModel.cs
-
tests/Avalonia.Controls.UnitTests/ToolTipTests.cs
|
|
|
@ -201,7 +201,6 @@ |
|
|
|
<Setter Property="HorizontalScrollBarVisibility" Value="Auto" /> |
|
|
|
<Setter Property="VerticalScrollBarVisibility" Value="Auto" /> |
|
|
|
<Setter Property="SelectionMode" Value="Extended" /> |
|
|
|
<Setter Property="GridLinesVisibility" Value="Vertical" /> |
|
|
|
<Setter Property="HorizontalGridLinesBrush" Value="{DynamicResource ThemeBorderHighColor}" /> |
|
|
|
<Setter Property="VerticalGridLinesBrush" Value="{DynamicResource ThemeBorderHighColor}" /> |
|
|
|
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderLowColor}"/> |
|
|
|
|
|
|
|
@ -55,7 +55,7 @@ namespace Avalonia.Controls |
|
|
|
/// <summary>
|
|
|
|
/// Stores the current <see cref="ToolTip"/> instance in the control.
|
|
|
|
/// </summary>
|
|
|
|
private static readonly AttachedProperty<ToolTip> ToolTipProperty = |
|
|
|
internal static readonly AttachedProperty<ToolTip> ToolTipProperty = |
|
|
|
AvaloniaProperty.RegisterAttached<ToolTip, Control, ToolTip>("ToolTip"); |
|
|
|
|
|
|
|
private IPopupHost _popup; |
|
|
|
|
|
|
|
@ -35,6 +35,13 @@ namespace Avalonia.Controls |
|
|
|
control.PointerEnter += ControlPointerEnter; |
|
|
|
control.PointerLeave += ControlPointerLeave; |
|
|
|
} |
|
|
|
|
|
|
|
if (ToolTip.GetIsOpen(control) && e.NewValue != e.OldValue && !(e.NewValue is ToolTip)) |
|
|
|
{ |
|
|
|
var tip = control.GetValue(ToolTip.ToolTipProperty); |
|
|
|
|
|
|
|
tip.Content = e.NewValue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
internal void TipOpenChanged(AvaloniaPropertyChangedEventArgs e) |
|
|
|
|
|
|
|
@ -71,7 +71,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 |
|
|
|
|
|
|
|
@ -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() |
|
|
|
|