From ca124732fa95ffa0462b389b2b84e8807d290a71 Mon Sep 17 00:00:00 2001 From: CJKmkp <2564608840@qq.com> Date: Mon, 6 Oct 2025 20:23:55 +0800 Subject: [PATCH] =?UTF-8?q?improve:=E8=AE=A1=E6=97=B6=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ink Canvas/Windows/FullscreenTimerWindow.xaml.cs | 4 +++- Ink Canvas/Windows/SeewoStyleTimerWindow.xaml.cs | 15 ++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Ink Canvas/Windows/FullscreenTimerWindow.xaml.cs b/Ink Canvas/Windows/FullscreenTimerWindow.xaml.cs index edd56364..060fc5da 100644 --- a/Ink Canvas/Windows/FullscreenTimerWindow.xaml.cs +++ b/Ink Canvas/Windows/FullscreenTimerWindow.xaml.cs @@ -28,7 +28,7 @@ namespace Ink_Canvas this.Height = SystemParameters.PrimaryScreenHeight; // 启动更新定时器 - updateTimer = new System.Timers.Timer(100); // 100ms更新一次 + updateTimer = new System.Timers.Timer(100); updateTimer.Elapsed += UpdateTimer_Elapsed; updateTimer.Start(); } @@ -105,6 +105,8 @@ namespace Ink_Canvas // 恢复主窗口 if (parentWindow != null) { + // 清除全屏模式标志 + parentWindow.SetFullscreenMode(false); parentWindow.Show(); parentWindow.Activate(); parentWindow.WindowState = WindowState.Normal; diff --git a/Ink Canvas/Windows/SeewoStyleTimerWindow.xaml.cs b/Ink Canvas/Windows/SeewoStyleTimerWindow.xaml.cs index 98b1b1bc..d07ffd70 100644 --- a/Ink Canvas/Windows/SeewoStyleTimerWindow.xaml.cs +++ b/Ink Canvas/Windows/SeewoStyleTimerWindow.xaml.cs @@ -94,6 +94,7 @@ namespace Ink_Canvas private Timer hideTimer; private MinimizedTimerWindow minimizedWindow; private DateTime lastActivityTime; + private bool isFullscreenMode = false; // 最近计时记录 private string recentTimer1 = "--:--"; @@ -206,11 +207,11 @@ namespace Ink_Canvas { Application.Current.Dispatcher.Invoke(() => { - // 只有在计时器运行时才检查自动隐藏 - if (isTimerRunning && !isPaused) + // 只有在计时器运行时且不在全屏模式下才检查自动隐藏 + if (isTimerRunning && !isPaused && !isFullscreenMode) { var timeSinceLastActivity = DateTime.Now - lastActivityTime; - if (timeSinceLastActivity.TotalSeconds >= 5) // 5秒无操作 + if (timeSinceLastActivity.TotalSeconds >= 5) { ShowMinimizedWindow(); } @@ -235,6 +236,11 @@ namespace Ink_Canvas lastActivityTime = DateTime.Now; } + public void SetFullscreenMode(bool isFullscreen) + { + isFullscreenMode = isFullscreen; + } + public bool IsTimerRunning => isTimerRunning; public TimeSpan? GetRemainingTime() @@ -1009,6 +1015,9 @@ namespace Ink_Canvas private void ShowFullscreenTimer() { + // 设置全屏模式标志 + isFullscreenMode = true; + // 创建全屏计时器窗口 var fullscreenWindow = new FullscreenTimerWindow(this); fullscreenWindow.Show();