Browse Source
Merge branch 'master' into 21-09-29-custom-draw-hit-test
pull/6657/head
Jumar Macato
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with
31 additions and
13 deletions
-
Documentation/build.md
-
src/Avalonia.Diagnostics/Diagnostics/Views/MainWindow.xaml.cs
-
src/Avalonia.Dialogs/AboutAvaloniaDialog.xaml.cs
-
src/Avalonia.Dialogs/ManagedFileChooser.cs
-
src/Avalonia.Dialogs/ManagedFileChooserSources.cs
-
src/Avalonia.Input/Gestures.cs
-
src/Avalonia.Input/MouseDevice.cs
-
src/Avalonia.Visuals/Rendering/ImmediateRenderer.cs
-
src/Avalonia.Visuals/Rendering/SceneGraph/SceneBuilder.cs
|
|
|
@ -6,6 +6,7 @@ Avalonia requires at least Visual Studio 2019 and .NET Core SDK 3.1 to build on |
|
|
|
|
|
|
|
``` |
|
|
|
git clone https://github.com/AvaloniaUI/Avalonia.git |
|
|
|
cd Avalonia |
|
|
|
git submodule update --init |
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
@ -160,13 +160,19 @@ namespace Avalonia.Diagnostics.Views |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
var root = Root; |
|
|
|
if (root is null) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
switch (e.Modifiers) |
|
|
|
{ |
|
|
|
case RawInputModifiers.Control | RawInputModifiers.Shift: |
|
|
|
{ |
|
|
|
IControl? control = null; |
|
|
|
|
|
|
|
foreach (var popupRoot in GetPopupRoots(Root)) |
|
|
|
foreach (var popupRoot in GetPopupRoots(root)) |
|
|
|
{ |
|
|
|
control = GetHoveredControl(popupRoot); |
|
|
|
|
|
|
|
@ -176,7 +182,7 @@ namespace Avalonia.Diagnostics.Views |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
control ??= GetHoveredControl(Root); |
|
|
|
control ??= GetHoveredControl(root); |
|
|
|
|
|
|
|
if (control != null) |
|
|
|
{ |
|
|
|
@ -190,7 +196,7 @@ namespace Avalonia.Diagnostics.Views |
|
|
|
{ |
|
|
|
vm.FreezePopups = !vm.FreezePopups; |
|
|
|
|
|
|
|
foreach (var popupRoot in GetPopupRoots(Root)) |
|
|
|
foreach (var popupRoot in GetPopupRoots(root)) |
|
|
|
{ |
|
|
|
if (popupRoot.Parent is Popup popup) |
|
|
|
{ |
|
|
|
|
|
|
|
@ -30,13 +30,13 @@ namespace Avalonia.Dialogs |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
using (Process process = Process.Start(new ProcessStartInfo |
|
|
|
using Process process = Process.Start(new ProcessStartInfo |
|
|
|
{ |
|
|
|
FileName = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? url : "open", |
|
|
|
Arguments = RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ? $"{url}" : "", |
|
|
|
CreateNoWindow = true, |
|
|
|
UseShellExecute = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) |
|
|
|
})); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -1,13 +1,11 @@ |
|
|
|
using System; |
|
|
|
using System.Linq; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using Avalonia; |
|
|
|
using Avalonia.Controls; |
|
|
|
using Avalonia.Controls.Primitives; |
|
|
|
using Avalonia.Input; |
|
|
|
using Avalonia.Interactivity; |
|
|
|
using Avalonia.LogicalTree; |
|
|
|
using Avalonia.Markup.Xaml; |
|
|
|
|
|
|
|
namespace Avalonia.Dialogs |
|
|
|
{ |
|
|
|
@ -35,7 +33,9 @@ namespace Avalonia.Dialogs |
|
|
|
if (_quickLinksRoot != null) |
|
|
|
{ |
|
|
|
var isQuickLink = _quickLinksRoot.IsLogicalAncestorOf(e.Source as Control); |
|
|
|
#pragma warning disable CS0618 // Type or member is obsolete
|
|
|
|
if (e.ClickCount == 2 || isQuickLink) |
|
|
|
#pragma warning restore CS0618 // Type or member is obsolete
|
|
|
|
{ |
|
|
|
if (model.ItemType == ManagedFileChooserItemType.File) |
|
|
|
{ |
|
|
|
|
|
|
|
@ -67,7 +67,7 @@ namespace Avalonia.Dialogs |
|
|
|
{ |
|
|
|
Directory.GetFiles(x.VolumePath); |
|
|
|
} |
|
|
|
catch (Exception _) |
|
|
|
catch (Exception) |
|
|
|
{ |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
@ -81,17 +81,21 @@ namespace Avalonia.Input |
|
|
|
var e = (PointerPressedEventArgs)ev; |
|
|
|
var visual = (IVisual)ev.Source; |
|
|
|
|
|
|
|
if (e.ClickCount <= 1) |
|
|
|
#pragma warning disable CS0618 // Type or member is obsolete
|
|
|
|
var clickCount = e.ClickCount; |
|
|
|
#pragma warning restore CS0618 // Type or member is obsolete
|
|
|
|
if (clickCount <= 1) |
|
|
|
{ |
|
|
|
s_lastPress = new WeakReference<IInteractive>(ev.Source); |
|
|
|
} |
|
|
|
else if (s_lastPress != null && e.ClickCount == 2 && e.GetCurrentPoint(visual).Properties.IsLeftButtonPressed) |
|
|
|
else if (s_lastPress != null && clickCount == 2 && e.GetCurrentPoint(visual).Properties.IsLeftButtonPressed) |
|
|
|
{ |
|
|
|
if (s_lastPress.TryGetTarget(out var target) && target == e.Source) |
|
|
|
{ |
|
|
|
e.Source.RaiseEvent(new TappedEventArgs(DoubleTappedEvent, e)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -75,7 +75,9 @@ namespace Avalonia.Input |
|
|
|
throw new InvalidOperationException("Control is not attached to visual tree."); |
|
|
|
} |
|
|
|
|
|
|
|
#pragma warning disable CS0618 // Type or member is obsolete
|
|
|
|
var rootPoint = relativeTo.VisualRoot.PointToClient(Position); |
|
|
|
#pragma warning restore CS0618 // Type or member is obsolete
|
|
|
|
var transform = relativeTo.VisualRoot.TransformToVisual(relativeTo); |
|
|
|
return rootPoint * transform!.Value; |
|
|
|
} |
|
|
|
|
|
|
|
@ -289,11 +289,14 @@ namespace Avalonia.Rendering |
|
|
|
|
|
|
|
using (context.PushPostTransform(m)) |
|
|
|
using (context.PushOpacity(opacity)) |
|
|
|
using (clipToBounds |
|
|
|
? visual is IVisualWithRoundRectClip roundClipVisual |
|
|
|
using (clipToBounds |
|
|
|
#pragma warning disable CS0618 // Type or member is obsolete
|
|
|
|
? visual is IVisualWithRoundRectClip roundClipVisual |
|
|
|
? context.PushClip(new RoundedRect(bounds, roundClipVisual.ClipToBoundsRadius)) |
|
|
|
: context.PushClip(bounds) |
|
|
|
: default(DrawingContext.PushedState)) |
|
|
|
#pragma warning restore CS0618 // Type or member is obsolete
|
|
|
|
|
|
|
|
using (visual.Clip != null ? context.PushGeometryClip(visual.Clip) : default(DrawingContext.PushedState)) |
|
|
|
using (visual.OpacityMask != null ? context.PushOpacityMask(visual.OpacityMask, bounds) : default(DrawingContext.PushedState)) |
|
|
|
using (context.PushTransformContainer()) |
|
|
|
|
|
|
|
@ -164,10 +164,12 @@ namespace Avalonia.Rendering.SceneGraph |
|
|
|
var visual = node.Visual; |
|
|
|
var opacity = visual.Opacity; |
|
|
|
var clipToBounds = visual.ClipToBounds; |
|
|
|
#pragma warning disable CS0618 // Type or member is obsolete
|
|
|
|
var clipToBoundsRadius = visual is IVisualWithRoundRectClip roundRectClip ? |
|
|
|
roundRectClip.ClipToBoundsRadius : |
|
|
|
default; |
|
|
|
|
|
|
|
#pragma warning restore CS0618 // Type or member is obsolete
|
|
|
|
|
|
|
|
var bounds = new Rect(visual.Bounds.Size); |
|
|
|
var contextImpl = (DeferredDrawingContextImpl)context.PlatformImpl; |
|
|
|
|
|
|
|
|