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
+46 -46
View File
@@ -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">
<Border Background="White" CornerRadius="15" BorderThickness="1" BorderBrush="#E0E0E0" Margin="10">
<Border Background="{DynamicResource SeewoTimerWindowBackground}" CornerRadius="15" BorderThickness="1" BorderBrush="{DynamicResource SeewoTimerWindowBorderBrush}" Margin="10">
<Grid>
<!-- 主要内容区域 -->
<Grid>
@@ -17,17 +17,17 @@
<Viewbox x:Name="MainViewController" Margin="20,20,20,20">
<Grid Height="350" Width="600">
<!-- 顶部标题栏 -->
<Grid Height="50" Background="White" x:Name="TitleBar" HorizontalAlignment="Stretch" VerticalAlignment="Top">
<Grid Height="50" Background="{DynamicResource SeewoTimerWindowBackground}" x:Name="TitleBar" HorizontalAlignment="Stretch" VerticalAlignment="Top">
<TextBlock Text="计时" FontSize="20" FontWeight="Bold"
HorizontalAlignment="Left" VerticalAlignment="Center"
Margin="22,0,0,0" Foreground="#333333" x:Name="TitleText"/>
Margin="22,0,0,0" Foreground="{DynamicResource SeewoTimerWindowTitleForeground}" x:Name="TitleText"/>
<Border x:Name="BtnClose" MouseUp="BtnClose_MouseUp"
HorizontalAlignment="Right" VerticalAlignment="Center"
Margin="0,0,22,0" Background="#F5F5F5" Height="30" Width="30"
Margin="0,0,22,0" Background="{DynamicResource SeewoTimerWindowButtonBackground}" Height="30" Width="30"
CornerRadius="15" Cursor="Hand">
<TextBlock Text="×" FontSize="16" FontWeight="Bold"
HorizontalAlignment="Center" VerticalAlignment="Center"
Foreground="#666666"/>
Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
</Border>
</Grid>
<!-- 6位数字显示区域 -->
@@ -43,7 +43,7 @@
<Grid Margin="0,0,15,0">
<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
<!-- 上方+按钮 -->
<Button x:Name="Digit1PlusBtn" Width="40" Height="40" Background="#F0F0F0"
<Button x:Name="Digit1PlusBtn" Width="40" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
BorderThickness="0" Click="Digit1Plus_Click" Cursor="Hand" Margin="0,0,0,8">
<Button.Template>
<ControlTemplate TargetType="Button">
@@ -52,13 +52,13 @@
</Border>
</ControlTemplate>
</Button.Template>
<TextBlock Text="+" FontSize="14" FontWeight="Bold" Foreground="#666666"/>
<TextBlock Text="+" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
</Button>
<!-- 数字显示 -->
<TextBlock x:Name="Digit1Display" Text="0" FontSize="64" FontWeight="Bold"
HorizontalAlignment="Center" Foreground="#333333" Margin="0,0,0,8"/>
HorizontalAlignment="Center" Foreground="{DynamicResource SeewoTimerWindowDigitForeground}" Margin="0,0,0,8"/>
<!-- 下方-按钮 -->
<Button x:Name="Digit1MinusBtn" Width="40" Height="40" Background="#F0F0F0"
<Button x:Name="Digit1MinusBtn" Width="40" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
BorderThickness="0" Click="Digit1Minus_Click" Cursor="Hand">
<Button.Template>
<ControlTemplate TargetType="Button">
@@ -67,7 +67,7 @@
</Border>
</ControlTemplate>
</Button.Template>
<TextBlock Text="-" FontSize="14" FontWeight="Bold" Foreground="#666666"/>
<TextBlock Text="-" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
</Button>
</StackPanel>
</Grid>
@@ -76,7 +76,7 @@
<Grid>
<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
<!-- 上方+按钮 -->
<Button x:Name="Digit2PlusBtn" Width="40" Height="40" Background="#F0F0F0"
<Button x:Name="Digit2PlusBtn" Width="40" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
BorderThickness="0" Click="Digit2Plus_Click" Cursor="Hand" Margin="0,0,0,8">
<Button.Template>
<ControlTemplate TargetType="Button">
@@ -85,13 +85,13 @@
</Border>
</ControlTemplate>
</Button.Template>
<TextBlock Text="+" FontSize="14" FontWeight="Bold" Foreground="#666666"/>
<TextBlock Text="+" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
</Button>
<!-- 数字显示 -->
<TextBlock x:Name="Digit2Display" Text="0" FontSize="64" FontWeight="Bold"
HorizontalAlignment="Center" Foreground="#333333" Margin="0,0,0,8"/>
HorizontalAlignment="Center" Foreground="{DynamicResource SeewoTimerWindowDigitForeground}" Margin="0,0,0,8"/>
<!-- 下方-按钮 -->
<Button x:Name="Digit2MinusBtn" Width="40" Height="40" Background="#F0F0F0"
<Button x:Name="Digit2MinusBtn" Width="40" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
BorderThickness="0" Click="Digit2Minus_Click" Cursor="Hand">
<Button.Template>
<ControlTemplate TargetType="Button">
@@ -100,14 +100,14 @@
</Border>
</ControlTemplate>
</Button.Template>
<TextBlock Text="-" FontSize="14" FontWeight="Bold" Foreground="#666666"/>
<TextBlock Text="-" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
</Button>
</StackPanel>
</Grid>
</StackPanel>
<!-- 时标签 -->
<TextBlock Text="时" FontSize="16" HorizontalAlignment="Center"
Foreground="#666666" Margin="0,112,0,-13"/>
Foreground="{DynamicResource SeewoTimerWindowButtonForeground}" Margin="0,112,0,-13"/>
</Grid>
<!-- 分钟组(十位和个位) -->
@@ -117,7 +117,7 @@
<Grid Margin="0,0,15,0">
<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
<!-- 上方+按钮 -->
<Button x:Name="Digit3PlusBtn" Width="40" Height="40" Background="#F0F0F0"
<Button x:Name="Digit3PlusBtn" Width="40" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
BorderThickness="0" Click="Digit3Plus_Click" Cursor="Hand" Margin="0,0,0,8">
<Button.Template>
<ControlTemplate TargetType="Button">
@@ -126,13 +126,13 @@
</Border>
</ControlTemplate>
</Button.Template>
<TextBlock Text="+" FontSize="14" FontWeight="Bold" Foreground="#666666"/>
<TextBlock Text="+" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
</Button>
<!-- 数字显示 -->
<TextBlock x:Name="Digit3Display" Text="0" FontSize="64" FontWeight="Bold"
HorizontalAlignment="Center" Foreground="#333333" Margin="0,0,0,8"/>
HorizontalAlignment="Center" Foreground="{DynamicResource SeewoTimerWindowDigitForeground}" Margin="0,0,0,8"/>
<!-- 下方-按钮 -->
<Button x:Name="Digit3MinusBtn" Width="40" Height="40" Background="#F0F0F0"
<Button x:Name="Digit3MinusBtn" Width="40" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
BorderThickness="0" Click="Digit3Minus_Click" Cursor="Hand">
<Button.Template>
<ControlTemplate TargetType="Button">
@@ -141,7 +141,7 @@
</Border>
</ControlTemplate>
</Button.Template>
<TextBlock Text="-" FontSize="14" FontWeight="Bold" Foreground="#666666"/>
<TextBlock Text="-" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
</Button>
</StackPanel>
</Grid>
@@ -150,7 +150,7 @@
<Grid>
<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
<!-- 上方+按钮 -->
<Button x:Name="Digit4PlusBtn" Width="40" Height="40" Background="#F0F0F0"
<Button x:Name="Digit4PlusBtn" Width="40" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
BorderThickness="0" Click="Digit4Plus_Click" Cursor="Hand" Margin="0,0,0,8">
<Button.Template>
<ControlTemplate TargetType="Button">
@@ -159,13 +159,13 @@
</Border>
</ControlTemplate>
</Button.Template>
<TextBlock Text="+" FontSize="14" FontWeight="Bold" Foreground="#666666"/>
<TextBlock Text="+" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
</Button>
<!-- 数字显示 -->
<TextBlock x:Name="Digit4Display" Text="5" FontSize="64" FontWeight="Bold"
HorizontalAlignment="Center" Foreground="#333333" Margin="0,0,0,8"/>
HorizontalAlignment="Center" Foreground="{DynamicResource SeewoTimerWindowDigitForeground}" Margin="0,0,0,8"/>
<!-- 下方-按钮 -->
<Button x:Name="Digit4MinusBtn" Width="40" Height="40" Background="#F0F0F0"
<Button x:Name="Digit4MinusBtn" Width="40" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
BorderThickness="0" Click="Digit4Minus_Click" Cursor="Hand">
<Button.Template>
<ControlTemplate TargetType="Button">
@@ -174,14 +174,14 @@
</Border>
</ControlTemplate>
</Button.Template>
<TextBlock Text="-" FontSize="14" FontWeight="Bold" Foreground="#666666"/>
<TextBlock Text="-" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
</Button>
</StackPanel>
</Grid>
</StackPanel>
<!-- 分标签 -->
<TextBlock Text="分" FontSize="16" HorizontalAlignment="Center"
Foreground="#666666" Margin="0,112,0,-12"/>
Foreground="{DynamicResource SeewoTimerWindowButtonForeground}" Margin="0,112,0,-12"/>
</Grid>
<!-- 秒组(十位和个位) -->
@@ -191,7 +191,7 @@
<Grid Margin="0,0,15,0">
<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
<!-- 上方+按钮 -->
<Button x:Name="Digit5PlusBtn" Width="40" Height="40" Background="#F0F0F0"
<Button x:Name="Digit5PlusBtn" Width="40" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
BorderThickness="0" Click="Digit5Plus_Click" Cursor="Hand" Margin="0,0,0,8">
<Button.Template>
<ControlTemplate TargetType="Button">
@@ -200,13 +200,13 @@
</Border>
</ControlTemplate>
</Button.Template>
<TextBlock Text="+" FontSize="14" FontWeight="Bold" Foreground="#666666"/>
<TextBlock Text="+" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
</Button>
<!-- 数字显示 -->
<TextBlock x:Name="Digit5Display" Text="0" FontSize="64" FontWeight="Bold"
HorizontalAlignment="Center" Foreground="#333333" Margin="0,0,0,8"/>
HorizontalAlignment="Center" Foreground="{DynamicResource SeewoTimerWindowDigitForeground}" Margin="0,0,0,8"/>
<!-- 下方-按钮 -->
<Button x:Name="Digit5MinusBtn" Width="40" Height="40" Background="#F0F0F0"
<Button x:Name="Digit5MinusBtn" Width="40" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
BorderThickness="0" Click="Digit5Minus_Click" Cursor="Hand">
<Button.Template>
<ControlTemplate TargetType="Button">
@@ -215,7 +215,7 @@
</Border>
</ControlTemplate>
</Button.Template>
<TextBlock Text="-" FontSize="14" FontWeight="Bold" Foreground="#666666"/>
<TextBlock Text="-" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
</Button>
</StackPanel>
</Grid>
@@ -224,7 +224,7 @@
<Grid>
<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
<!-- 上方+按钮 -->
<Button x:Name="Digit6PlusBtn" Width="40" Height="40" Background="#F0F0F0"
<Button x:Name="Digit6PlusBtn" Width="40" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
BorderThickness="0" Click="Digit6Plus_Click" Cursor="Hand" Margin="0,0,0,8">
<Button.Template>
<ControlTemplate TargetType="Button">
@@ -233,13 +233,13 @@
</Border>
</ControlTemplate>
</Button.Template>
<TextBlock Text="+" FontSize="14" FontWeight="Bold" Foreground="#666666"/>
<TextBlock Text="+" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
</Button>
<!-- 数字显示 -->
<TextBlock x:Name="Digit6Display" Text="0" FontSize="64" FontWeight="Bold"
HorizontalAlignment="Center" Foreground="#333333" Margin="0,0,0,8"/>
HorizontalAlignment="Center" Foreground="{DynamicResource SeewoTimerWindowDigitForeground}" Margin="0,0,0,8"/>
<!-- 下方-按钮 -->
<Button x:Name="Digit6MinusBtn" Width="40" Height="40" Background="#F0F0F0"
<Button x:Name="Digit6MinusBtn" Width="40" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
BorderThickness="0" Click="Digit6Minus_Click" Cursor="Hand">
<Button.Template>
<ControlTemplate TargetType="Button">
@@ -248,14 +248,14 @@
</Border>
</ControlTemplate>
</Button.Template>
<TextBlock Text="-" FontSize="14" FontWeight="Bold" Foreground="#666666"/>
<TextBlock Text="-" FontSize="14" FontWeight="Bold" Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
</Button>
</StackPanel>
</Grid>
</StackPanel>
<!-- 秒标签 -->
<TextBlock Text="秒" FontSize="16" HorizontalAlignment="Center"
Foreground="#666666" Margin="0,112,0,-12"/>
Foreground="{DynamicResource SeewoTimerWindowButtonForeground}" Margin="0,112,0,-12"/>
</Grid>
</StackPanel>
@@ -265,7 +265,7 @@
<Grid HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,0,0,20">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<!-- 全屏按钮 -->
<Button x:Name="FullscreenBtn" Width="80" Height="40" Background="#F5F5F5"
<Button x:Name="FullscreenBtn" Width="80" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
BorderThickness="0" Click="Fullscreen_Click" Cursor="Hand" Margin="0,0,30,0">
<Button.Template>
<ControlTemplate TargetType="Button">
@@ -275,13 +275,13 @@
</ControlTemplate>
</Button.Template>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<TextBlock Text="⛶" FontSize="16" Foreground="#666666" Margin="0,0,5,0"/>
<TextBlock Text="全屏" FontSize="12" Foreground="#666666"/>
<TextBlock Text="⛶" FontSize="16" Foreground="{DynamicResource SeewoTimerWindowButtonForeground}" Margin="0,0,5,0"/>
<TextBlock Text="全屏" FontSize="12" Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
</StackPanel>
</Button>
<!-- 开始/暂停按钮 -->
<Button x:Name="StartPauseBtn" Width="80" Height="80" Background="#4CAF50"
<Button x:Name="StartPauseBtn" Width="80" Height="80" Background="{DynamicResource SeewoTimerWindowPrimaryButtonBackground}"
BorderThickness="0" Click="StartPause_Click" Cursor="Hand" Margin="0,0,30,0">
<Button.Template>
<ControlTemplate TargetType="Button">
@@ -290,12 +290,12 @@
</Border>
</ControlTemplate>
</Button.Template>
<TextBlock x:Name="StartPauseIcon" Text="▶" FontSize="32" Foreground="White"
<TextBlock x:Name="StartPauseIcon" Text="▶" FontSize="32" Foreground="{DynamicResource SeewoTimerWindowPrimaryButtonForeground}"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
<!-- 重置按钮 -->
<Button x:Name="ResetBtn" Width="80" Height="40" Background="#F5F5F5"
<Button x:Name="ResetBtn" Width="80" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
BorderThickness="0" Click="Reset_Click" Cursor="Hand">
<Button.Template>
<ControlTemplate TargetType="Button">
@@ -305,8 +305,8 @@
</ControlTemplate>
</Button.Template>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<TextBlock Text="↻" FontSize="16" Foreground="#666666" Margin="0,0,5,0"/>
<TextBlock Text="重置" FontSize="12" Foreground="#666666"/>
<TextBlock Text="↻" FontSize="16" Foreground="{DynamicResource SeewoTimerWindowButtonForeground}" Margin="0,0,5,0"/>
<TextBlock Text="重置" FontSize="12" Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
</StackPanel>
</Button>
</StackPanel>