From 915aff2eeace37ad57b16493c348159e64a2f715 Mon Sep 17 00:00:00 2001 From: zhouzj Date: Mon, 5 Dec 2022 14:34:33 +0800 Subject: [PATCH 1/3] Prevent showing trayMenu if the menu is empty. --- src/Windows/Avalonia.Win32/TrayIconImpl.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Windows/Avalonia.Win32/TrayIconImpl.cs b/src/Windows/Avalonia.Win32/TrayIconImpl.cs index 8d565d7fef..ddc42b3248 100644 --- a/src/Windows/Avalonia.Win32/TrayIconImpl.cs +++ b/src/Windows/Avalonia.Win32/TrayIconImpl.cs @@ -19,7 +19,7 @@ namespace Avalonia.Win32 public class TrayIconImpl : ITrayIconImpl { private static readonly IntPtr s_emptyIcon = new System.Drawing.Bitmap(32, 32).GetHicon(); - + private readonly int _uniqueId; private static int s_nextUniqueId; private bool _iconAdded; @@ -137,6 +137,12 @@ namespace Avalonia.Win32 private void OnRightClicked() { + var menuItems = _exporter.GetMenu(); + if (null == menuItems || menuItems.Count == 0) + { + return; + } + var _trayMenu = new TrayPopupRoot() { SystemDecorations = SystemDecorations.None, @@ -145,7 +151,7 @@ namespace Avalonia.Win32 TransparencyLevelHint = WindowTransparencyLevel.Transparent, Content = new TrayIconMenuFlyoutPresenter() { - Items = _exporter.GetMenu() + Items = menuItems } }; From 19043beda148892ee5d60d5786c9c811c0170309 Mon Sep 17 00:00:00 2001 From: zhouzj Date: Mon, 5 Dec 2022 14:40:10 +0800 Subject: [PATCH 2/3] fix typo --- src/Windows/Avalonia.Win32/TrayIconImpl.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Windows/Avalonia.Win32/TrayIconImpl.cs b/src/Windows/Avalonia.Win32/TrayIconImpl.cs index ddc42b3248..ab70d77a09 100644 --- a/src/Windows/Avalonia.Win32/TrayIconImpl.cs +++ b/src/Windows/Avalonia.Win32/TrayIconImpl.cs @@ -19,7 +19,6 @@ namespace Avalonia.Win32 public class TrayIconImpl : ITrayIconImpl { private static readonly IntPtr s_emptyIcon = new System.Drawing.Bitmap(32, 32).GetHicon(); - private readonly int _uniqueId; private static int s_nextUniqueId; private bool _iconAdded; From 845fea9d1103eb0487335d55ff0488fe66d22c5f Mon Sep 17 00:00:00 2001 From: Kevin Ivarsen Date: Mon, 5 Dec 2022 14:36:33 -0800 Subject: [PATCH 3/3] Swap the figures used for expanded/collapsed groups in DataGrid to match the standard convention. --- src/Avalonia.Controls.DataGrid/Themes/Fluent.xaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Avalonia.Controls.DataGrid/Themes/Fluent.xaml b/src/Avalonia.Controls.DataGrid/Themes/Fluent.xaml index a3c0ed1d0c..fb4335f4de 100644 --- a/src/Avalonia.Controls.DataGrid/Themes/Fluent.xaml +++ b/src/Avalonia.Controls.DataGrid/Themes/Fluent.xaml @@ -6,8 +6,8 @@ M1875 1011l-787 787v-1798h-128v1798l-787 -787l-90 90l941 941l941 -941z M1965 947l-941 -941l-941 941l90 90l787 -787v1798h128v-1798l787 787z - M515 93l930 931l-930 931l90 90l1022 -1021l-1022 -1021z - M109 486 19 576 1024 1581 2029 576 1939 486 1024 1401z + M515 93l930 931l-930 931l90 90l1022 -1021l-1022 -1021z + M109 486 19 576 1024 1581 2029 576 1939 486 1024 1401z