improve:主题切换

This commit is contained in:
2025-10-04 21:55:55 +08:00
parent eef2a915fa
commit 402f8bb9f9
8 changed files with 224 additions and 78 deletions
@@ -23,6 +23,9 @@ namespace Ink_Canvas
timer.Elapsed += Timer_Elapsed;
timer.Interval = 50;
InitializeUI();
// 应用主题
ApplyTheme();
}
@@ -84,6 +87,28 @@ namespace Ink_Canvas
UpdateDigitDisplays();
}
private void ApplyTheme()
{
try
{
// 根据主题设置数字显示颜色
var digitForeground = Application.Current.FindResource("SeewoTimerWindowDigitForeground") as SolidColorBrush;
if (digitForeground != null)
{
Digit1Display.Foreground = digitForeground;
Digit2Display.Foreground = digitForeground;
Digit3Display.Foreground = digitForeground;
Digit4Display.Foreground = digitForeground;
Digit5Display.Foreground = digitForeground;
Digit6Display.Foreground = digitForeground;
}
}
catch (Exception ex)
{
LogHelper.WriteLogToFile($"应用仿希沃倒计时窗口主题出错: {ex.Message}", LogHelper.LogType.Error);
}
}
private void UpdateDigitDisplays()
{
Digit1Display.Text = (hour / 10).ToString();