Browse Source

Merge branch 'master' into fixes/textProcessing

pull/10009/head
Benedikt Stebner 3 years ago
committed by GitHub
parent
commit
eb3e4f0bc7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      src/Avalonia.Base/Animation/Animatable.cs
  2. 2
      src/Avalonia.Base/Data/InstancedBinding.cs
  3. 4
      src/Avalonia.Base/Metadata/InheritDataTypeFromItemsAttribute.cs
  4. 2
      src/Avalonia.Base/Rendering/SceneGraph/IDrawOperation.cs
  5. 5
      src/Avalonia.Controls/Automation/Peers/ListItemAutomationPeer.cs
  6. 2
      src/Avalonia.Controls/TreeViewItem.cs
  7. 2
      src/Linux/Avalonia.LinuxFramebuffer/LinuxFramebufferPlatform.cs
  8. 6
      src/Linux/Avalonia.LinuxFramebuffer/Output/DrmOutput.cs

14
src/Avalonia.Base/Animation/Animatable.cs

@ -27,6 +27,7 @@ namespace Avalonia.Animation
AvaloniaProperty.Register<Animatable, Transitions?>(nameof(Transitions));
private bool _transitionsEnabled = true;
private bool _isSubscribedToTransitionsCollection = false;
private Dictionary<ITransition, TransitionState>? _transitionState;
/// <summary>
@ -62,6 +63,11 @@ namespace Avalonia.Animation
if (Transitions is object)
{
if (!_isSubscribedToTransitionsCollection)
{
_isSubscribedToTransitionsCollection = true;
Transitions.CollectionChanged += TransitionsCollectionChanged;
}
AddTransitions(Transitions);
}
}
@ -72,7 +78,7 @@ namespace Avalonia.Animation
/// </summary>
/// <remarks>
/// This method should not be called from user code, it will be called automatically by the framework
/// when a control is added to the visual tree.
/// when a control is removed from the visual tree.
/// </remarks>
protected void DisableTransitions()
{
@ -82,6 +88,11 @@ namespace Avalonia.Animation
if (Transitions is object)
{
if (_isSubscribedToTransitionsCollection)
{
_isSubscribedToTransitionsCollection = false;
Transitions.CollectionChanged -= TransitionsCollectionChanged;
}
RemoveTransitions(Transitions);
}
}
@ -110,6 +121,7 @@ namespace Avalonia.Animation
}
newTransitions.CollectionChanged += TransitionsCollectionChanged;
_isSubscribedToTransitionsCollection = true;
AddTransitions(toAdd);
}

2
src/Avalonia.Base/Data/InstancedBinding.cs

@ -23,7 +23,7 @@ namespace Avalonia.Data
/// <param name="priority">The priority of the binding.</param>
/// <remarks>
/// This constructor can be used to create any type of binding and as such requires an
/// <see cref="ISubject{Object}"/> as the binding source because this is the only binding
/// <see cref="IObservable{Object}"/> as the binding source because this is the only binding
/// source which can be used for all binding modes. If you wish to create an instance with
/// something other than a subject, use one of the static creation methods on this class.
/// </remarks>

4
src/Avalonia.Base/Metadata/InheritDataTypeFromItemsAttribute.cs

@ -25,9 +25,9 @@ public sealed class InheritDataTypeFromItemsAttribute : Attribute
/// The name of the property whose item type should be used on the target property.
/// </summary>
public string AncestorItemsProperty { get; }
/// <summary>
/// The ancestor type to be used in a lookup for the <see cref="AncestorProperty"/>.
/// The ancestor type to be used in a lookup for the <see cref="AncestorItemsProperty"/>.
/// If null, the declaring type of the target property is used.
/// </summary>
public Type? AncestorType { get; set; }

2
src/Avalonia.Base/Rendering/SceneGraph/IDrawOperation.cs

@ -19,7 +19,7 @@ namespace Avalonia.Rendering.SceneGraph
/// <param name="p">The point in global coordinates.</param>
/// <returns>True if the point hits the node's geometry; otherwise false.</returns>
/// <remarks>
/// This method does not recurse to child <see cref="IVisualNode"/>s, if you want
/// This method does not recurse to childs, if you want
/// to hit test children they must be hit tested manually.
/// </remarks>
bool HitTest(Point p);

5
src/Avalonia.Controls/Automation/Peers/ListItemAutomationPeer.cs

@ -1,5 +1,4 @@
using System;
using Avalonia.Automation.Provider;
using Avalonia.Automation.Provider;
using Avalonia.Controls;
using Avalonia.Controls.Primitives;
using Avalonia.Controls.Selection;
@ -64,7 +63,7 @@ namespace Avalonia.Automation.Peers
if (Owner.Parent is ItemsControl parent &&
parent.GetValue(ListBox.SelectionProperty) is ISelectionModel selectionModel)
{
var index = parent.ItemContainerGenerator.IndexFromContainer(Owner);
var index = parent.IndexFromContainer(Owner);
if (index != -1)
selectionModel.Deselect(index);

2
src/Avalonia.Controls/TreeViewItem.cs

@ -257,7 +257,7 @@ namespace Avalonia.Controls
Dispatcher.UIThread.Post(this.BringIntoView); // must use the Dispatcher, otherwise the TreeView doesn't scroll
}
}
/// <summary>
/// Invoked when the <see cref="InputElement.DoubleTapped"/> event occurs in the header.
/// </summary>

2
src/Linux/Avalonia.LinuxFramebuffer/LinuxFramebufferPlatform.cs

@ -154,7 +154,7 @@ public static class LinuxFramebufferPlatformExtensions
var lifetime = LinuxFramebufferPlatform.Initialize(builder, outputBackend, inputBackend);
builder.SetupWithLifetime(lifetime);
lifetime.Start(args);
builder.Instance.Run(lifetime.Token);
builder.Instance!.Run(lifetime.Token);
return lifetime.ExitCode;
}
}

6
src/Linux/Avalonia.LinuxFramebuffer/Output/DrmOutput.cs

@ -43,13 +43,13 @@ namespace Avalonia.LinuxFramebuffer.Output
public IPlatformGraphics PlatformGraphics { get; private set; }
public DrmOutput(DrmCard card, DrmResources resources, DrmConnector connector, DrmModeInfo modeInfo,
DrmOutputOptions? options = null)
DrmOutputOptions options = null)
{
if(options != null)
_outputOptions = options;
Init(card, resources, connector, modeInfo);
}
public DrmOutput(string path = null, bool connectorsForceProbe = false, DrmOutputOptions? options = null)
public DrmOutput(string path = null, bool connectorsForceProbe = false, DrmOutputOptions options = null)
{
if(options != null)
_outputOptions = options;
@ -63,7 +63,7 @@ namespace Avalonia.LinuxFramebuffer.Output
if(connector == null)
throw new InvalidOperationException("Unable to find connected DRM connector");
DrmModeInfo? mode = null;
DrmModeInfo mode = null;
if (options?.VideoMode != null)
{

Loading…
Cancel
Save