From 78c07a12d06c9500cd8ba8a41d9735f74e27f83b Mon Sep 17 00:00:00 2001 From: Solin Date: Sun, 18 Jan 2026 20:55:31 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E6=AC=A1=E5=90=AF=E5=8A=A8=E6=97=B6=E7=9A=84=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E6=8F=90=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AppSettings.cs | 1 + MainForm.cs | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/AppSettings.cs b/AppSettings.cs index 01930de..263c90c 100644 --- a/AppSettings.cs +++ b/AppSettings.cs @@ -10,6 +10,7 @@ namespace TimerApp public int RestMinutes { get; set; } = 1; public int IdleThresholdSeconds { get; set; } = 30; public bool IsDarkMode { get; set; } = true; + public bool HasShownMinimizeTip { get; set; } = false; private static string LegacyConfigPath => Path.Combine(AppContext.BaseDirectory, "settings.json"); diff --git a/MainForm.cs b/MainForm.cs index 780f861..0d7fef1 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -524,15 +524,14 @@ namespace TimerApp notifyIcon1.ShowBalloonTip(3000, "休息结束", "继续加油工作吧!", ToolTipIcon.Info); } - private bool _hasShownMinimizeTip = false; - private void btnHide_Click(object sender, EventArgs e) { this.Hide(); - if (!_hasShownMinimizeTip) + if (!_settings.HasShownMinimizeTip) { notifyIcon1.ShowBalloonTip(2000, "已隐藏", "程序仍在后台运行,双击托盘图标恢复。", ToolTipIcon.Info); - _hasShownMinimizeTip = true; + _settings.HasShownMinimizeTip = true; + _settings.Save(); } } @@ -542,10 +541,11 @@ namespace TimerApp { e.Cancel = true; this.Hide(); - if (!_hasShownMinimizeTip) + if (!_settings.HasShownMinimizeTip) { notifyIcon1.ShowBalloonTip(2000, "已隐藏", "程序仍在后台运行,双击托盘图标恢复。", ToolTipIcon.Info); - _hasShownMinimizeTip = true; + _settings.HasShownMinimizeTip = true; + _settings.Save(); } } else