From 22ef68e43960f57368c593ca31841fe90c9f4f3a Mon Sep 17 00:00:00 2001 From: Gundlack Florian Date: Thu, 13 Jul 2023 13:45:16 +0200 Subject: [PATCH 1/6] Fixed issue where RowDetailsTemplate was getting the wrong DataContext --- src/Avalonia.Controls.DataGrid/DataGridRows.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Avalonia.Controls.DataGrid/DataGridRows.cs b/src/Avalonia.Controls.DataGrid/DataGridRows.cs index 44079d24d0..107a2a7353 100644 --- a/src/Avalonia.Controls.DataGrid/DataGridRows.cs +++ b/src/Avalonia.Controls.DataGrid/DataGridRows.cs @@ -2970,10 +2970,7 @@ namespace Avalonia.Controls if (detailsContent != null) { _rowsPresenter.Children.Add(detailsContent); - if (dataItem != null) - { - detailsContent.DataContext = dataItem; - } + detailsContent.DataContext = dataItem; detailsContent.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity)); RowDetailsHeightEstimate = detailsContent.DesiredSize.Height; _rowsPresenter.Children.Remove(detailsContent); From 3fc0d19ad017a819535a0610058652aa07d57348 Mon Sep 17 00:00:00 2001 From: Gundlack Florian Date: Thu, 13 Jul 2023 15:47:28 +0200 Subject: [PATCH 2/6] Moved detailsContent.DataContext assignation before Children.Add --- src/Avalonia.Controls.DataGrid/DataGridRows.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Avalonia.Controls.DataGrid/DataGridRows.cs b/src/Avalonia.Controls.DataGrid/DataGridRows.cs index 107a2a7353..c9a348d172 100644 --- a/src/Avalonia.Controls.DataGrid/DataGridRows.cs +++ b/src/Avalonia.Controls.DataGrid/DataGridRows.cs @@ -2969,8 +2969,8 @@ namespace Avalonia.Controls var detailsContent = RowDetailsTemplate.Build(dataItem); if (detailsContent != null) { - _rowsPresenter.Children.Add(detailsContent); detailsContent.DataContext = dataItem; + _rowsPresenter.Children.Add(detailsContent); detailsContent.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity)); RowDetailsHeightEstimate = detailsContent.DesiredSize.Height; _rowsPresenter.Children.Remove(detailsContent); From 5d2b9edec35c1a8f159b85ac547979a349855a94 Mon Sep 17 00:00:00 2001 From: daniilpavliuchyk Date: Tue, 25 Jul 2023 19:27:16 +0300 Subject: [PATCH 3/6] Fix window incorrect positioning with window startup location CenterScreen on MacOS --- native/Avalonia.Native/src/OSX/WindowBaseImpl.mm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/native/Avalonia.Native/src/OSX/WindowBaseImpl.mm b/native/Avalonia.Native/src/OSX/WindowBaseImpl.mm index b954bdd4e3..1a4f979ce7 100644 --- a/native/Avalonia.Native/src/OSX/WindowBaseImpl.mm +++ b/native/Avalonia.Native/src/OSX/WindowBaseImpl.mm @@ -151,6 +151,14 @@ HRESULT WindowBaseImpl::Hide() { @autoreleasepool { if (Window != nullptr) { + auto frame = [Window frame]; + + AvnPoint point; + point.X = frame.origin.x; + point.Y = frame.origin.y + frame.size.height; + + lastPositionSet = ConvertPointY(point); + hasPosition = true; [Window orderOut:Window]; } From 608c251fb27bd37b5ceb1224b62b53954cce67d7 Mon Sep 17 00:00:00 2001 From: Color_yr <402067010@qq.com> Date: Fri, 28 Jul 2023 06:32:34 +0000 Subject: [PATCH 4/6] Make the animation display complete --- src/Avalonia.Base/Animation/CrossFade.cs | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/Avalonia.Base/Animation/CrossFade.cs b/src/Avalonia.Base/Animation/CrossFade.cs index 640d6456a3..d598db870f 100644 --- a/src/Avalonia.Base/Animation/CrossFade.cs +++ b/src/Avalonia.Base/Animation/CrossFade.cs @@ -35,6 +35,18 @@ namespace Avalonia.Animation { Children = { + new KeyFrame() + { + Setters = + { + new Setter + { + Property = Visual.OpacityProperty, + Value = 1d + } + }, + Cue = new Cue(0d) + }, new KeyFrame() { Setters = @@ -54,6 +66,18 @@ namespace Avalonia.Animation { Children = { + new KeyFrame() + { + Setters = + { + new Setter + { + Property = Visual.OpacityProperty, + Value = 0d + } + }, + Cue = new Cue(0d) + }, new KeyFrame() { Setters = @@ -117,11 +141,13 @@ namespace Avalonia.Animation if (from != null) { + from.Opacity = 0f; tasks.Add(_fadeOutAnimation.RunAsync(from, null, cancellationToken)); } if (to != null) { + to.Opacity = 1f; to.IsVisible = true; tasks.Add(_fadeInAnimation.RunAsync(to, null, cancellationToken)); } From 55c9da56ebc569e061b7a34b5ae02ea748978ebb Mon Sep 17 00:00:00 2001 From: Giuseppe Lippolis Date: Fri, 28 Jul 2023 16:10:13 +0200 Subject: [PATCH 5/6] feat(NumericUpDown): TextAlignment --- .../NumericUpDown/NumericUpDown.cs | 15 +++++++++++++++ .../Controls/NumericUpDown.xaml | 1 + .../Controls/NumericUpDown.xaml | 1 + 3 files changed, 17 insertions(+) diff --git a/src/Avalonia.Controls/NumericUpDown/NumericUpDown.cs b/src/Avalonia.Controls/NumericUpDown/NumericUpDown.cs index 30f9d8f380..84772e7789 100644 --- a/src/Avalonia.Controls/NumericUpDown/NumericUpDown.cs +++ b/src/Avalonia.Controls/NumericUpDown/NumericUpDown.cs @@ -126,6 +126,12 @@ namespace Avalonia.Controls public static readonly StyledProperty VerticalContentAlignmentProperty = ContentControl.VerticalContentAlignmentProperty.AddOwner(); + /// + /// Defines the property + /// + public static readonly StyledProperty TextAlignmentProperty = + TextBox.TextAlignmentProperty.AddOwner(); + private IDisposable? _textBoxTextChangedSubscription; private bool _internalValueSet; @@ -299,6 +305,15 @@ namespace Avalonia.Controls set => SetValue(VerticalContentAlignmentProperty, value); } + /// + /// Gets or sets the of the + /// + public Media.TextAlignment TextAlignment + { + get => GetValue(TextAlignmentProperty); + set => SetValue(TextAlignmentProperty, value); + } + /// /// Initializes new instance of class. /// diff --git a/src/Avalonia.Themes.Fluent/Controls/NumericUpDown.xaml b/src/Avalonia.Themes.Fluent/Controls/NumericUpDown.xaml index 1f84ee664c..a470eb1d3b 100644 --- a/src/Avalonia.Themes.Fluent/Controls/NumericUpDown.xaml +++ b/src/Avalonia.Themes.Fluent/Controls/NumericUpDown.xaml @@ -57,6 +57,7 @@ VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Text="{TemplateBinding Text}" + TextAlignment="{TemplateBinding TextAlignment}" AcceptsReturn="False" TextWrapping="NoWrap" /> diff --git a/src/Avalonia.Themes.Simple/Controls/NumericUpDown.xaml b/src/Avalonia.Themes.Simple/Controls/NumericUpDown.xaml index 4ce6a20dc6..ff4be12fda 100644 --- a/src/Avalonia.Themes.Simple/Controls/NumericUpDown.xaml +++ b/src/Avalonia.Themes.Simple/Controls/NumericUpDown.xaml @@ -31,6 +31,7 @@ DataValidationErrors.Errors="{TemplateBinding (DataValidationErrors.Errors)}" IsReadOnly="{TemplateBinding IsReadOnly}" Text="{TemplateBinding Text}" + TextAlignment="{TemplateBinding TextAlignment}" TextWrapping="NoWrap" Watermark="{TemplateBinding Watermark}" /> From e1ac9be7f1ae659a44c449e692946977c330af29 Mon Sep 17 00:00:00 2001 From: Will Kennedy Date: Sat, 29 Jul 2023 15:14:50 -0400 Subject: [PATCH 6/6] Catch errors so that for loop can register all names --- .../DBusIme/DBusTextInputMethodBase.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Avalonia.FreeDesktop/DBusIme/DBusTextInputMethodBase.cs b/src/Avalonia.FreeDesktop/DBusIme/DBusTextInputMethodBase.cs index 9ce6604594..b897d52204 100644 --- a/src/Avalonia.FreeDesktop/DBusIme/DBusTextInputMethodBase.cs +++ b/src/Avalonia.FreeDesktop/DBusIme/DBusTextInputMethodBase.cs @@ -62,9 +62,15 @@ namespace Avalonia.FreeDesktop.DBusIme foreach (var name in _knownNames) { var dbus = new OrgFreedesktopDBus(Connection, "org.freedesktop.DBus", "/org/freedesktop/DBus"); - _disposables.Add(await dbus.WatchNameOwnerChangedAsync(OnNameChange)); - var nameOwner = await dbus.GetNameOwnerAsync(name); - OnNameChange(null, (name, null, nameOwner)); + try + { + _disposables.Add(await dbus.WatchNameOwnerChangedAsync(OnNameChange)); + var nameOwner = await dbus.GetNameOwnerAsync(name); + OnNameChange(null, (name, null, nameOwner)); + } + catch (DBusException) + { + } } }