From d62630881ef8630a21d0e26b57a10bfea1f315e8 Mon Sep 17 00:00:00 2001 From: NullptrVoid <2963169251@qq.com> Date: Mon, 24 Aug 2026 13:01:10 +0800 Subject: [PATCH 1/2] =?UTF-8?q?improve:=E4=BC=98=E5=8C=96=E8=AE=A1?= =?UTF-8?q?=E6=97=B6=E5=99=A8=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ink Canvas/Windows/NewStyleMinimizedTimerWindow.xaml.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Ink Canvas/Windows/NewStyleMinimizedTimerWindow.xaml.cs b/Ink Canvas/Windows/NewStyleMinimizedTimerWindow.xaml.cs index e644c8695..884d0ee41 100644 --- a/Ink Canvas/Windows/NewStyleMinimizedTimerWindow.xaml.cs +++ b/Ink Canvas/Windows/NewStyleMinimizedTimerWindow.xaml.cs @@ -63,6 +63,7 @@ private void UpdateTimer_Elapsed(object sender, ElapsedEventArgs e) if (!IsVisible) return; if (_shouldHide != null && _shouldHide()) { + _restoreCallback?.Invoke(); Close(); return; } From bb31ba00e5a5890aeba99f00dd098864bf0bb19f Mon Sep 17 00:00:00 2001 From: NullptrVoid <2963169251@qq.com> Date: Tue, 6 Oct 2026 15:11:22 +0800 Subject: [PATCH 2/2] =?UTF-8?q?add:=E9=80=9A=E7=9F=A5=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BD=8D=E7=BD=AE=E5=BA=95=E6=A0=8F=E4=BB=A5?= =?UTF-8?q?=E4=B8=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ink Canvas/MainWindow_cs/MW_Notification.cs | 51 +++++++++++++++++++ .../NotificationStrings.Designer.cs | 2 + .../Properties/NotificationStrings.en-US.resx | 5 +- .../Properties/NotificationStrings.resx | 5 +- .../Properties/NotificationStrings.zh-ME.resx | 3 ++ .../SettingsViews/Pages/NotificationPage.xaml | 1 + 6 files changed, 65 insertions(+), 2 deletions(-) diff --git a/Ink Canvas/MainWindow_cs/MW_Notification.cs b/Ink Canvas/MainWindow_cs/MW_Notification.cs index 6983b86fe..f710ee763 100644 --- a/Ink Canvas/MainWindow_cs/MW_Notification.cs +++ b/Ink Canvas/MainWindow_cs/MW_Notification.cs @@ -180,6 +180,9 @@ private void ApplyDynamicNotificationPlacement(NotificationMessage message = nul case "FloatingBarAbove": ApplyDynamicNotificationFloatingBarPlacement(); break; + case "BottomBarAbove": + ApplyDynamicNotificationBottomBarPlacement(); + break; } } @@ -211,6 +214,54 @@ private void ApplyDynamicNotificationFloatingBarPlacement() } } + private void ApplyDynamicNotificationBottomBarPlacement() + { + if (DynamicNotification == null || ViewboxFloatingBar == null) + { + return; + } + try + { + if(ViewboxFloatingBar.Visibility == Visibility.Visible) + { + //这里浮动栏是在的,直接采用浮动栏上方的计算方法 + ApplyDynamicNotificationFloatingBarPlacement(); + return; + } + else + { + if(isFloatingBarFolded && BlackboardCenterSide.Visibility!=Visibility.Visible || BlackboardCenterSide.ActualWidth < 1 || BlackboardCenterSide.ActualHeight < 1) + { + //这时的情况应是点击了浮动栏隐藏或白板未完成布局,直接顶部居中 + DynamicNotification.HorizontalAlignment = HorizontalAlignment.Center; + DynamicNotification.VerticalAlignment = VerticalAlignment.Top; + DynamicNotification.Margin = new Thickness(0); + return; + } + if (BlackboardCenterSide.Visibility == Visibility.Visible) + { + //进白板了 + var topLeft = BlackboardCenterSide.TranslatePoint(new Point(0, 0), this); + var bottomRight = BlackboardCenterSide.TranslatePoint( + new Point(BlackboardCenterSide.ActualWidth, BlackboardCenterSide.ActualHeight), this); + double notificationWidth = DynamicNotification.ActualWidth > 0 ? DynamicNotification.ActualWidth : DynamicNotification.Width; + double notificationHeight = DynamicNotification.ActualHeight > 0 ? DynamicNotification.ActualHeight : 72; + double left = (topLeft.X + bottomRight.X) / 2 - notificationWidth / 2; + double top = topLeft.Y - notificationHeight - 12; + left = Math.Max(12, Math.Min(ActualWidth - notificationWidth - 12, left)); + top = Math.Max(12, top); + + DynamicNotification.HorizontalAlignment = HorizontalAlignment.Left; + DynamicNotification.VerticalAlignment = VerticalAlignment.Top; + DynamicNotification.Margin = new Thickness(left, top, 0, 0); + } + } + } + catch + { + + } + } private void OnAnnouncementUnreadCountChanged() { if (_startupUnreadNotificationShown) return; diff --git a/Ink Canvas/Properties/NotificationStrings.Designer.cs b/Ink Canvas/Properties/NotificationStrings.Designer.cs index c3c2fe8ed..7427eb6f2 100644 --- a/Ink Canvas/Properties/NotificationStrings.Designer.cs +++ b/Ink Canvas/Properties/NotificationStrings.Designer.cs @@ -106,6 +106,8 @@ public static string GetString(string key) public static string PlacementFloatingBarAbove => ResourceManager.GetString(nameof(PlacementFloatingBarAbove), _resourceCulture); + public static string PlacementBottomBarAbove => ResourceManager.GetString(nameof(PlacementBottomBarAbove), _resourceCulture); + public static string PlacementTopCenter => ResourceManager.GetString(nameof(PlacementTopCenter), _resourceCulture); public static string PlacementTopLeft => ResourceManager.GetString(nameof(PlacementTopLeft), _resourceCulture); diff --git a/Ink Canvas/Properties/NotificationStrings.en-US.resx b/Ink Canvas/Properties/NotificationStrings.en-US.resx index 370d335fc..afc1cc777 100644 --- a/Ink Canvas/Properties/NotificationStrings.en-US.resx +++ b/Ink Canvas/Properties/NotificationStrings.en-US.resx @@ -1,4 +1,4 @@ - + @@ -150,6 +150,9 @@ Above floating toolbar + + Above bottom bar + Announcement provider diff --git a/Ink Canvas/Properties/NotificationStrings.resx b/Ink Canvas/Properties/NotificationStrings.resx index 0bd00da9f..1501765ad 100644 --- a/Ink Canvas/Properties/NotificationStrings.resx +++ b/Ink Canvas/Properties/NotificationStrings.resx @@ -1,4 +1,4 @@ - + @@ -150,6 +150,9 @@ 浮动栏上方 + + 底栏上方 + 公告提供商 diff --git a/Ink Canvas/Properties/NotificationStrings.zh-ME.resx b/Ink Canvas/Properties/NotificationStrings.zh-ME.resx index cb56a2fe4..ea63f4729 100644 --- a/Ink Canvas/Properties/NotificationStrings.zh-ME.resx +++ b/Ink Canvas/Properties/NotificationStrings.zh-ME.resx @@ -150,6 +150,9 @@ 浮动栏上方 + + 底栏上方 + 公告提供商 diff --git a/Ink Canvas/Windows/SettingsViews/Pages/NotificationPage.xaml b/Ink Canvas/Windows/SettingsViews/Pages/NotificationPage.xaml index 7aeac5e3e..883e1497e 100644 --- a/Ink Canvas/Windows/SettingsViews/Pages/NotificationPage.xaml +++ b/Ink Canvas/Windows/SettingsViews/Pages/NotificationPage.xaml @@ -130,6 +130,7 @@ +