Browse Source
Merge branch 'master' into textInputMethodClientRework
pull/11848/head
Emmanuel Hansen
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
46 additions and
6 deletions
-
src/Avalonia.Controls.DataGrid/Themes/Fluent.xaml
-
src/Avalonia.Controls/Presenters/ScrollContentPresenter.cs
-
src/Avalonia.X11/X11Clipboard.cs
-
tests/Avalonia.Controls.UnitTests/Presenters/ScrollContentPresenterTests.cs
|
|
|
@ -42,9 +42,10 @@ |
|
|
|
|
|
|
|
</ResourceDictionary> |
|
|
|
</ResourceDictionary.ThemeDictionaries> |
|
|
|
|
|
|
|
|
|
|
|
<x:Double x:Key="ListAccentLowOpacity">0.6</x:Double> |
|
|
|
<x:Double x:Key="ListAccentMediumOpacity">0.8</x:Double> |
|
|
|
<x:Double x:Key="DataGridSortIconMinWidth">32</x:Double> |
|
|
|
|
|
|
|
<StreamGeometry x:Key="DataGridSortIconDescendingPath">M1875 1011l-787 787v-1798h-128v1798l-787 -787l-90 90l941 941l941 -941z</StreamGeometry> |
|
|
|
<StreamGeometry x:Key="DataGridSortIconAscendingPath">M1965 947l-941 -941l-941 941l90 90l787 -787v1798h128v-1798l787 787z</StreamGeometry> |
|
|
|
@ -174,7 +175,7 @@ |
|
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"> |
|
|
|
<Grid.ColumnDefinitions> |
|
|
|
<ColumnDefinition Width="*" /> |
|
|
|
<ColumnDefinition Width="Auto" MinWidth="32" /> |
|
|
|
<ColumnDefinition Width="Auto" MinWidth="{DynamicResource DataGridSortIconMinWidth}" /> |
|
|
|
</Grid.ColumnDefinitions> |
|
|
|
|
|
|
|
<ContentPresenter Content="{TemplateBinding Content}" |
|
|
|
@ -512,7 +513,7 @@ |
|
|
|
BorderBrush="{TemplateBinding BorderBrush}" |
|
|
|
BorderThickness="{TemplateBinding BorderThickness}" |
|
|
|
CornerRadius="{TemplateBinding CornerRadius}"> |
|
|
|
<Grid ColumnDefinitions="Auto,*,Auto" |
|
|
|
<Grid ColumnDefinitions="Auto,*,Auto" |
|
|
|
RowDefinitions="Auto,*,Auto,Auto" |
|
|
|
ClipToBounds="True"> |
|
|
|
<DataGridColumnHeader Name="PART_TopLeftCornerHeader" |
|
|
|
|
|
|
|
@ -7,7 +7,7 @@ using Avalonia.Input.GestureRecognizers; |
|
|
|
using Avalonia.Utilities; |
|
|
|
using Avalonia.VisualTree; |
|
|
|
using System.Linq; |
|
|
|
using Avalonia.Interactivity; |
|
|
|
using Avalonia.Layout; |
|
|
|
|
|
|
|
namespace Avalonia.Controls.Presenters |
|
|
|
{ |
|
|
|
@ -473,7 +473,15 @@ namespace Avalonia.Controls.Presenters |
|
|
|
} |
|
|
|
|
|
|
|
Viewport = finalSize; |
|
|
|
Extent = Child!.Bounds.Size.Inflate(Child.Margin); |
|
|
|
|
|
|
|
var childMargin = Child!.Margin; |
|
|
|
if (Child.UseLayoutRounding) |
|
|
|
{ |
|
|
|
var scale = LayoutHelper.GetLayoutScale(Child); |
|
|
|
childMargin = LayoutHelper.RoundLayoutThickness(childMargin, scale, scale); |
|
|
|
} |
|
|
|
|
|
|
|
Extent = Child!.Bounds.Size.Inflate(childMargin); |
|
|
|
_isAnchorElementDirty = true; |
|
|
|
|
|
|
|
return finalSize; |
|
|
|
|
|
|
|
@ -224,7 +224,7 @@ namespace Avalonia.X11 |
|
|
|
|
|
|
|
private Task<object> SendDataRequest(IntPtr format) |
|
|
|
{ |
|
|
|
if (_requestedDataTcs == null || _requestedFormatsTcs.Task.IsCompleted) |
|
|
|
if (_requestedDataTcs == null || _requestedDataTcs.Task.IsCompleted) |
|
|
|
_requestedDataTcs = new TaskCompletionSource<object>(); |
|
|
|
XConvertSelection(_x11.Display, _x11.Atoms.CLIPBOARD, format, format, _handle, IntPtr.Zero); |
|
|
|
return _requestedDataTcs.Task; |
|
|
|
|
|
|
|
@ -4,6 +4,7 @@ using System.Reactive.Linq; |
|
|
|
using Avalonia.Controls.Presenters; |
|
|
|
using Avalonia.Controls.Primitives; |
|
|
|
using Avalonia.Layout; |
|
|
|
using Avalonia.UnitTests; |
|
|
|
using Xunit; |
|
|
|
|
|
|
|
namespace Avalonia.Controls.UnitTests.Presenters |
|
|
|
@ -244,6 +245,36 @@ namespace Avalonia.Controls.UnitTests.Presenters |
|
|
|
Assert.Equal(new Size(110, 110), target.Extent); |
|
|
|
} |
|
|
|
|
|
|
|
[Fact] |
|
|
|
public void Extent_Should_Include_Content_Margin_Scaled_With_Layout_Rounding() |
|
|
|
{ |
|
|
|
var root = new TestRoot |
|
|
|
{ |
|
|
|
LayoutScaling = 1.25, |
|
|
|
UseLayoutRounding = true |
|
|
|
}; |
|
|
|
|
|
|
|
var target = new ScrollContentPresenter |
|
|
|
{ |
|
|
|
HorizontalAlignment = HorizontalAlignment.Center, |
|
|
|
VerticalAlignment = VerticalAlignment.Center, |
|
|
|
Content = new Border |
|
|
|
{ |
|
|
|
Width = 200, |
|
|
|
Height = 200, |
|
|
|
Margin = new Thickness(2) |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
root.Child = target; |
|
|
|
target.UpdateChild(); |
|
|
|
target.Measure(new Size(1000, 1000)); |
|
|
|
target.Arrange(new Rect(0, 0, 1000, 1000)); |
|
|
|
|
|
|
|
Assert.Equal(new Size(203.2, 203.2), target.Viewport); |
|
|
|
Assert.Equal(new Size(203.2, 203.2), target.Extent); |
|
|
|
} |
|
|
|
|
|
|
|
[Fact] |
|
|
|
public void Extent_Width_Should_Be_Arrange_Width_When_CanScrollHorizontally_False() |
|
|
|
{ |
|
|
|
|