Repository navigation
add:通知显示新增位置底栏上方 #695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: net10
Are you sure you want to change the base?
add:通知显示新增位置底栏上方 #695
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -184,6 +184,9 @@ private void ApplyDynamicNotificationPlacement(NotificationMessage message = nul | |
| case "FloatingBarAbove": | ||
| ApplyDynamicNotificationFloatingBarPlacement(); | ||
| break; | ||
| case "BottomBarAbove": | ||
| ApplyDynamicNotificationBottomBarPlacement(); | ||
| break; | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -219,6 +222,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; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At Severity: medium 🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage. |
||
| 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; | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At
Ink Canvas/MainWindow_cs/MW_Notification.cs:188, consider entering whiteboard mode while a notification is already visible:ApplyDynamicNotificationPlacementruns only when a notification is requested, andSwitchBackgroundnever recalculates its margin. The notification therefore remains at the desktop floating-toolbar coordinates instead of moving aboveBlackboardCenterSide, and similarly retains the whiteboard position on exit.Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.