diff --git a/Ink Canvas/Resources/Styles/Dark.xaml b/Ink Canvas/Resources/Styles/Dark.xaml index cf7caa06..5bfa83e2 100644 --- a/Ink Canvas/Resources/Styles/Dark.xaml +++ b/Ink Canvas/Resources/Styles/Dark.xaml @@ -81,6 +81,7 @@ + @@ -92,6 +93,9 @@ + + + diff --git a/Ink Canvas/Resources/Styles/Light.xaml b/Ink Canvas/Resources/Styles/Light.xaml index a62365a4..61d16a7a 100644 --- a/Ink Canvas/Resources/Styles/Light.xaml +++ b/Ink Canvas/Resources/Styles/Light.xaml @@ -81,6 +81,7 @@ + @@ -92,6 +93,9 @@ + + + diff --git a/Ink Canvas/Windows/CountdownTimerWindow.xaml b/Ink Canvas/Windows/CountdownTimerWindow.xaml index 0a2c3f87..093f416b 100644 --- a/Ink Canvas/Windows/CountdownTimerWindow.xaml +++ b/Ink Canvas/Windows/CountdownTimerWindow.xaml @@ -12,7 +12,7 @@ Title="Ink Canvas 画板 - 计时器" Height="700" Width="1100"> - + @@ -171,7 +171,7 @@ Height="18" CornerRadius="9" VerticalAlignment="Center" HorizontalAlignment="Center"> - + diff --git a/Ink Canvas/Windows/CountdownTimerWindow.xaml.cs b/Ink Canvas/Windows/CountdownTimerWindow.xaml.cs index 7e8f9505..4f662605 100644 --- a/Ink Canvas/Windows/CountdownTimerWindow.xaml.cs +++ b/Ink Canvas/Windows/CountdownTimerWindow.xaml.cs @@ -69,7 +69,15 @@ namespace Ink_Canvas isTimerRunning = false; SymbolIconStart.Symbol = iNKORE.UI.WPF.Modern.Controls.Symbol.Play; BtnStartCover.Visibility = Visibility.Visible; - TextBlockHour.Foreground = new SolidColorBrush(StringToColor("#FF5B5D5F")); + var textForeground = Application.Current.FindResource("TimerWindowTextForeground") as SolidColorBrush; + if (textForeground != null) + { + TextBlockHour.Foreground = textForeground; + } + else + { + TextBlockHour.Foreground = new SolidColorBrush(StringToColor("#FF5B5D5F")); + } BorderStopTime.Visibility = Visibility.Collapsed; } }); @@ -103,17 +111,34 @@ namespace Ink_Canvas private void Grid_MouseUp(object sender, MouseButtonEventArgs e) { if (isTimerRunning) return; + + var textForeground = Application.Current.FindResource("TimerWindowTextForeground") as SolidColorBrush; + if (ProcessBarTime.Visibility == Visibility.Visible && isTimerRunning == false) { ProcessBarTime.Visibility = Visibility.Collapsed; GridAdjustHour.Visibility = Visibility.Visible; - TextBlockHour.Foreground = Brushes.Black; + if (textForeground != null) + { + TextBlockHour.Foreground = textForeground; + } + else + { + TextBlockHour.Foreground = Brushes.Black; + } } else { ProcessBarTime.Visibility = Visibility.Visible; GridAdjustHour.Visibility = Visibility.Collapsed; - TextBlockHour.Foreground = new SolidColorBrush(StringToColor("#FF5B5D5F")); + if (textForeground != null) + { + TextBlockHour.Foreground = textForeground; + } + else + { + TextBlockHour.Foreground = new SolidColorBrush(StringToColor("#FF5B5D5F")); + } if (hour == 0 && minute == 0 && second == 0) { @@ -238,7 +263,11 @@ namespace Ink_Canvas BtnResetCover.Visibility = Visibility.Visible; BtnStartCover.Visibility = Visibility.Collapsed; BorderStopTime.Visibility = Visibility.Collapsed; - TextBlockHour.Foreground = new SolidColorBrush(StringToColor("#FF5B5D5F")); + var textForeground3 = Application.Current.FindResource("TimerWindowTextForeground") as SolidColorBrush; + if (textForeground3 != null) + TextBlockHour.Foreground = textForeground3; + else + TextBlockHour.Foreground = new SolidColorBrush(StringToColor("#FF5B5D5F")); } else if (isTimerRunning && isPaused) { @@ -248,7 +277,11 @@ namespace Ink_Canvas BtnResetCover.Visibility = Visibility.Visible; BtnStartCover.Visibility = Visibility.Collapsed; BorderStopTime.Visibility = Visibility.Collapsed; - TextBlockHour.Foreground = new SolidColorBrush(StringToColor("#FF5B5D5F")); + var textForeground3 = Application.Current.FindResource("TimerWindowTextForeground") as SolidColorBrush; + if (textForeground3 != null) + TextBlockHour.Foreground = textForeground3; + else + TextBlockHour.Foreground = new SolidColorBrush(StringToColor("#FF5B5D5F")); SymbolIconStart.Symbol = iNKORE.UI.WPF.Modern.Controls.Symbol.Play; isTimerRunning = false; timer.Stop(); @@ -298,7 +331,11 @@ namespace Ink_Canvas //继续 startTime += DateTime.Now - pauseTime; ProcessBarTime.IsPaused = false; - TextBlockHour.Foreground = Brushes.Black; + var textForeground1 = Application.Current.FindResource("TimerWindowTextForeground") as SolidColorBrush; + if (textForeground1 != null) + TextBlockHour.Foreground = textForeground1; + else + TextBlockHour.Foreground = Brushes.Black; SymbolIconStart.Symbol = iNKORE.UI.WPF.Modern.Controls.Symbol.Pause; isPaused = false; timer.Start(); @@ -310,7 +347,11 @@ namespace Ink_Canvas //暂停 pauseTime = DateTime.Now; ProcessBarTime.IsPaused = true; - TextBlockHour.Foreground = new SolidColorBrush(StringToColor("#FF5B5D5F")); + var textForeground3 = Application.Current.FindResource("TimerWindowTextForeground") as SolidColorBrush; + if (textForeground3 != null) + TextBlockHour.Foreground = textForeground3; + else + TextBlockHour.Foreground = new SolidColorBrush(StringToColor("#FF5B5D5F")); SymbolIconStart.Symbol = iNKORE.UI.WPF.Modern.Controls.Symbol.Play; BorderStopTime.Visibility = Visibility.Collapsed; isPaused = true; @@ -322,7 +363,11 @@ namespace Ink_Canvas startTime = DateTime.Now; totalSeconds = ((hour * 60) + minute) * 60 + second; ProcessBarTime.IsPaused = false; - TextBlockHour.Foreground = Brushes.Black; + var textForeground2 = Application.Current.FindResource("TimerWindowTextForeground") as SolidColorBrush; + if (textForeground2 != null) + TextBlockHour.Foreground = textForeground2; + else + TextBlockHour.Foreground = Brushes.Black; SymbolIconStart.Symbol = iNKORE.UI.WPF.Modern.Controls.Symbol.Pause; BtnResetCover.Visibility = Visibility.Collapsed;