From 6fe34c1250c944bf694cd832acfacadf01257fe1 Mon Sep 17 00:00:00 2001 From: PrefacedCorg <1876568293@qq.com> Date: Sat, 20 Dec 2025 13:28:47 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=99=BD=E6=9D=BF=E5=92=8C=E6=89=B9?= =?UTF-8?q?=E6=B3=A8=E6=A8=A1=E5=BC=8F=E8=87=AA=E5=8A=A8=E5=85=A8=E5=B1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MainWindow_cs/MW_FloatingBarIcons.cs | 75 +++++++++++++------ 1 file changed, 51 insertions(+), 24 deletions(-) diff --git a/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs b/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs index 2c71db66..16343fa6 100644 --- a/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs +++ b/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs @@ -2039,6 +2039,10 @@ namespace Ink_Canvas GridTransparencyFakeBackground.Background = Brushes.Transparent; GridBackgroundCoverHolder.Visibility = Visibility.Collapsed; + + // 点击鼠标按钮退出批注模式时的全屏还原 + RestoreFullScreenOnExitAnnotationMode(); + inkCanvas.Select(new StrokeCollection()); GridInkCanvasSelectionCover.Visibility = Visibility.Collapsed; @@ -2152,6 +2156,21 @@ namespace Ink_Canvas BtnHideInkCanvas.Content = "隐藏\n画板"; + // 进入批注模式时的全屏处理(仅当未应用过全屏处理时) + if (Settings.Advanced.IsEnableAvoidFullScreenHelper && !isFullScreenApplied) + { + // 设置为画板模式,允许全屏操作 + AvoidFullScreenHelper.SetBoardMode(true); + Dispatcher.BeginInvoke(new Action(() => + { + MainWindow.MoveWindow(new WindowInteropHelper(this).Handle, 0, 0, + System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width, + System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height, true); + }), DispatcherPriority.ApplicationIdle); + + isFullScreenApplied = true; // 标记已应用全屏处理 + } + StackPanelCanvasControls.Visibility = Visibility.Visible; //AnimationsHelper.ShowWithSlideFromLeftAndFade(StackPanelCanvasControls); CheckEnableTwoFingerGestureBtnVisibility(true); @@ -2993,6 +3012,30 @@ namespace Ink_Canvas private int currentMode; + // 退出批注模式时的全屏还原处理 + private void RestoreFullScreenOnExitAnnotationMode() + { + if (Settings.Advanced.IsEnableAvoidFullScreenHelper && + isFullScreenApplied && + currentMode == 0 && // 不在白板模式 + BtnPPTSlideShowEnd.Visibility != Visibility.Visible) // 不在PPT放映模式 + { + // 恢复为非画板模式,重新启用全屏限制 + AvoidFullScreenHelper.SetBoardMode(false); + + Dispatcher.BeginInvoke(new Action(() => + { + // 退出批注模式,恢复到工作区域大小 + var workingArea = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea; + MainWindow.MoveWindow(new WindowInteropHelper(this).Handle, + workingArea.Left, workingArea.Top, + workingArea.Width, workingArea.Height, true); + }), DispatcherPriority.ApplicationIdle); + + isFullScreenApplied = false; // 标记全屏处理已还原 + } + } + private void BtnSwitch_Click(object sender, RoutedEventArgs e) { if (GridTransparencyFakeBackground.Background == Brushes.Transparent) @@ -3061,8 +3104,9 @@ namespace Ink_Canvas ClearStrokes(true); RestoreStrokes(true); - // 退出白板模式时取消全屏 - if (Settings.Advanced.IsEnableAvoidFullScreenHelper) + // 退出白板模式时取消全屏(仅在非PPT模式下) + if (Settings.Advanced.IsEnableAvoidFullScreenHelper && + BtnPPTSlideShowEnd.Visibility != Visibility.Visible) // 不在PPT放映模式 { // 恢复为非画板模式,重新启用全屏限制 AvoidFullScreenHelper.SetBoardMode(false); @@ -3135,8 +3179,9 @@ namespace Ink_Canvas RestoreStrokes(); - // 进入白板模式时全屏 - if (Settings.Advanced.IsEnableAvoidFullScreenHelper) + // 进入白板模式时全屏(仅在非PPT模式下) + if (Settings.Advanced.IsEnableAvoidFullScreenHelper && + BtnPPTSlideShowEnd.Visibility != Visibility.Visible) // 不在PPT放映模式 { // 设置为画板模式,允许全屏操作 AvoidFullScreenHelper.SetBoardMode(true); @@ -3295,26 +3340,8 @@ namespace Ink_Canvas GridBackgroundCoverHolder.Visibility = Visibility.Collapsed; - // 退出批注模式时的全屏还原(仅当之前应用过全屏处理且不在白板模式时) - if (Settings.Advanced.IsEnableAvoidFullScreenHelper && - isFullScreenApplied && - currentMode == 0 && // 不在白板模式 - BtnPPTSlideShowEnd.Visibility != Visibility.Visible) // 不在PPT放映模式 - { - // 恢复为非画板模式,重新启用全屏限制 - AvoidFullScreenHelper.SetBoardMode(false); - - Dispatcher.BeginInvoke(new Action(() => - { - // 退出批注模式,恢复到工作区域大小 - var workingArea = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea; - MainWindow.MoveWindow(new WindowInteropHelper(this).Handle, - workingArea.Left, workingArea.Top, - workingArea.Width, workingArea.Height, true); - }), DispatcherPriority.ApplicationIdle); - - isFullScreenApplied = false; // 标记全屏处理已还原 - } + // 退出批注模式时的全屏还原 + RestoreFullScreenOnExitAnnotationMode(); if (currentMode != 0) {