diff --git a/Ink Canvas/Resources/Styles/Dark.xaml b/Ink Canvas/Resources/Styles/Dark.xaml index e8c4dcd0..cf7caa06 100644 --- a/Ink Canvas/Resources/Styles/Dark.xaml +++ b/Ink Canvas/Resources/Styles/Dark.xaml @@ -67,4 +67,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Ink Canvas/Resources/Styles/Light.xaml b/Ink Canvas/Resources/Styles/Light.xaml index 280e950c..a62365a4 100644 --- a/Ink Canvas/Resources/Styles/Light.xaml +++ b/Ink Canvas/Resources/Styles/Light.xaml @@ -67,4 +67,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Ink Canvas/Windows/CountdownTimerWindow.xaml b/Ink Canvas/Windows/CountdownTimerWindow.xaml index 0f820a2d..0a2c3f87 100644 --- a/Ink Canvas/Windows/CountdownTimerWindow.xaml +++ b/Ink Canvas/Windows/CountdownTimerWindow.xaml @@ -10,7 +10,7 @@ mc:Ignorable="d" WindowStyle="None" AllowsTransparency="True" Loaded="Window_Loaded" Closing="Window_Closing" WindowStartupLocation="CenterScreen" Title="Ink Canvas 画板 - 计时器" Height="700" Width="1100"> - + @@ -22,7 +22,7 @@ HorizontalAlignment="Center"> @@ -69,7 +69,7 @@ FontWeight="DemiBold"/> @@ -128,7 +128,7 @@ FontWeight="DemiBold"/> @@ -167,17 +167,17 @@ - - + - + @@ -189,12 +189,12 @@ - + - + @@ -210,22 +210,22 @@ + Background="{DynamicResource TimerWindowButtonBackground}" Height="20" Width="20" CornerRadius="100"> - + + Background="{DynamicResource TimerWindowButtonBackground}" Height="20" Width="20" CornerRadius="100"> - + - + @@ -21,14 +21,14 @@ - - + @@ -51,8 +51,8 @@ - - + + @@ -79,49 +79,51 @@ + HorizontalAlignment="Center" Foreground="{DynamicResource RandWindowTextForeground}"/> + HorizontalAlignment="Center" Foreground="{DynamicResource RandWindowTextForeground}"/> + IsReadOnly="True" + Foreground="{DynamicResource RandWindowTextForeground}"> 全都抽 只抽男 只抽女 - + - + + IsEditable="False" IsReadOnly="True" SelectedIndex="0" + Foreground="{DynamicResource RandWindowTextForeground}"> ClassIsland点名 SecRandom点名 NamePicker点名 - + - + - + @@ -129,15 +131,15 @@ - + - + - + diff --git a/Ink Canvas/Windows/RandWindow.xaml.cs b/Ink Canvas/Windows/RandWindow.xaml.cs index f8f568fe..dd2aba29 100644 --- a/Ink Canvas/Windows/RandWindow.xaml.cs +++ b/Ink Canvas/Windows/RandWindow.xaml.cs @@ -34,6 +34,9 @@ namespace Ink_Canvas // 加载背景 LoadBackground(settings); + // 应用主题 + ApplyTheme(settings); + // 设置窗口为置顶 Topmost = true; @@ -75,6 +78,27 @@ namespace Ink_Canvas } } + private void ApplyTheme(Settings settings) + { + try + { + // 根据主题设置窗口背景 + if (settings.RandSettings.SelectedBackgroundIndex <= 0) + { + // 没有自定义背景时,使用主题背景色 + var backgroundBrush = Application.Current.FindResource("RandWindowBackground") as SolidColorBrush; + if (backgroundBrush != null) + { + MainBorder.Background = backgroundBrush; + } + } + } + catch (Exception ex) + { + LogHelper.WriteLogToFile($"应用点名窗口主题出错: {ex.Message}", LogHelper.LogType.Error); + } + } + public RandWindow(Settings settings, bool IsAutoClose) { InitializeComponent(); @@ -88,6 +112,9 @@ namespace Ink_Canvas // 加载背景 LoadBackground(settings); + // 应用主题 + ApplyTheme(settings); + // 设置窗口为置顶 Topmost = true; diff --git a/Ink Canvas/Windows/SeewoStyleTimerWindow.xaml b/Ink Canvas/Windows/SeewoStyleTimerWindow.xaml index 1e36d25d..feb4d67f 100644 --- a/Ink Canvas/Windows/SeewoStyleTimerWindow.xaml +++ b/Ink Canvas/Windows/SeewoStyleTimerWindow.xaml @@ -9,7 +9,7 @@ mc:Ignorable="d" WindowStyle="None" AllowsTransparency="True" Loaded="Window_Loaded" Closing="Window_Closing" WindowStartupLocation="CenterScreen" Title="Ink Canvas 画板 - 计时器" Height="400" Width="600"> - + @@ -17,17 +17,17 @@ - + + Margin="22,0,0,0" Foreground="{DynamicResource SeewoTimerWindowTitleForeground}" x:Name="TitleText"/> + Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/> @@ -43,7 +43,7 @@ - + HorizontalAlignment="Center" Foreground="{DynamicResource SeewoTimerWindowDigitForeground}" Margin="0,0,0,8"/> - @@ -76,7 +76,7 @@ - + HorizontalAlignment="Center" Foreground="{DynamicResource SeewoTimerWindowDigitForeground}" Margin="0,0,0,8"/> - + Foreground="{DynamicResource SeewoTimerWindowButtonForeground}" Margin="0,112,0,-13"/> @@ -117,7 +117,7 @@ - + HorizontalAlignment="Center" Foreground="{DynamicResource SeewoTimerWindowDigitForeground}" Margin="0,0,0,8"/> - @@ -150,7 +150,7 @@ - + HorizontalAlignment="Center" Foreground="{DynamicResource SeewoTimerWindowDigitForeground}" Margin="0,0,0,8"/> - + Foreground="{DynamicResource SeewoTimerWindowButtonForeground}" Margin="0,112,0,-12"/> @@ -191,7 +191,7 @@ - + HorizontalAlignment="Center" Foreground="{DynamicResource SeewoTimerWindowDigitForeground}" Margin="0,0,0,8"/> - @@ -224,7 +224,7 @@ - + HorizontalAlignment="Center" Foreground="{DynamicResource SeewoTimerWindowDigitForeground}" Margin="0,0,0,8"/> - + Foreground="{DynamicResource SeewoTimerWindowButtonForeground}" Margin="0,112,0,-12"/> @@ -265,7 +265,7 @@ - - - diff --git a/Ink Canvas/Windows/SeewoStyleTimerWindow.xaml.cs b/Ink Canvas/Windows/SeewoStyleTimerWindow.xaml.cs index f8bac5cf..3ca5c612 100644 --- a/Ink Canvas/Windows/SeewoStyleTimerWindow.xaml.cs +++ b/Ink Canvas/Windows/SeewoStyleTimerWindow.xaml.cs @@ -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();