improve:计时器UI

This commit is contained in:
2025-10-06 16:53:00 +08:00
parent adc2d02fbb
commit 20d5dd2668
2 changed files with 265 additions and 76 deletions
+179 -68
View File
@@ -388,70 +388,11 @@
<Grid HorizontalAlignment="Right" VerticalAlignment="Center"
x:Name="QuickOptionsGrid" Width="350" Margin="30,0,0,0">
<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
<!-- 第一排:5min, 10min -->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,0,0,15">
<Button x:Name="Quick5MinBtn" Width="80" Height="50" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
BorderThickness="0" Click="Quick5Min_Click" Cursor="Hand" Margin="0,0,15,0">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="8">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Button.Template>
<TextBlock Text="5分钟" FontSize="16" FontWeight="Bold"
Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
</Button>
<Button x:Name="Quick10MinBtn" Width="80" Height="50" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
BorderThickness="0" Click="Quick10Min_Click" Cursor="Hand">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="8">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Button.Template>
<TextBlock Text="10分钟" FontSize="16" FontWeight="Bold"
Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
</Button>
</StackPanel>
<!-- 第二排:15min, 20min -->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,0,0,15">
<Button x:Name="Quick15MinBtn" Width="80" Height="50" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
BorderThickness="0" Click="Quick15Min_Click" Cursor="Hand" Margin="0,0,15,0">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="8">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Button.Template>
<TextBlock Text="15分钟" FontSize="16" FontWeight="Bold"
Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
</Button>
<Button x:Name="Quick20MinBtn" Width="80" Height="50" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
BorderThickness="0" Click="Quick20Min_Click" Cursor="Hand">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="8">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Button.Template>
<TextBlock Text="20分钟" FontSize="16" FontWeight="Bold"
Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
</Button>
</StackPanel>
<!-- 第三排:最近两次计时 -->
<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
<TextBlock Text="最近计时" FontSize="14" FontWeight="Bold"
Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"
HorizontalAlignment="Center" Margin="0,0,0,10"/>
<!-- Tab切换区域 -->
<Grid Margin="0,0,0,20">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Button x:Name="RecentTimer1Btn" Width="80" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
BorderThickness="0" Click="RecentTimer1_Click" Cursor="Hand" Margin="0,0,10,0">
<Button x:Name="CommonTabBtn" Width="100" Height="35" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
BorderThickness="0" Click="CommonTab_Click" Cursor="Hand" Margin="0,0,10,0">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="6">
@@ -459,11 +400,11 @@
</Border>
</ControlTemplate>
</Button.Template>
<TextBlock x:Name="RecentTimer1Text" Text="--:--" FontSize="14" FontWeight="Bold"
<TextBlock Text="常用" FontSize="14" FontWeight="Bold"
Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
</Button>
<Button x:Name="RecentTimer2Btn" Width="80" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
BorderThickness="0" Click="RecentTimer2_Click" Cursor="Hand">
<Button x:Name="RecentTabBtn" Width="100" Height="35" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
BorderThickness="0" Click="RecentTab_Click" Cursor="Hand">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="6">
@@ -471,11 +412,181 @@
</Border>
</ControlTemplate>
</Button.Template>
<TextBlock x:Name="RecentTimer2Text" Text="--:--" FontSize="14" FontWeight="Bold"
<TextBlock Text="最近" FontSize="14" FontWeight="Bold"
Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
</Button>
</StackPanel>
</StackPanel>
</Grid>
<!-- 常用计时区域 -->
<Grid x:Name="CommonTimersGrid" Visibility="Visible">
<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
<!-- 第一排:5分钟, 10分钟, 15分钟 -->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,0,0,10">
<Button x:Name="Common5MinBtn" Width="70" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
BorderThickness="0" Click="Common5Min_Click" Cursor="Hand" Margin="0,0,8,0">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="6">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Button.Template>
<TextBlock Text="05:00" FontSize="12" FontWeight="Bold"
Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
</Button>
<Button x:Name="Common10MinBtn" Width="70" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
BorderThickness="0" Click="Common10Min_Click" Cursor="Hand" Margin="0,0,8,0">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="6">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Button.Template>
<TextBlock Text="10:00" FontSize="12" FontWeight="Bold"
Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
</Button>
<Button x:Name="Common15MinBtn" Width="70" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
BorderThickness="0" Click="Common15Min_Click" Cursor="Hand">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="6">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Button.Template>
<TextBlock Text="15:00" FontSize="12" FontWeight="Bold"
Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
</Button>
</StackPanel>
<!-- 第二排:30分钟, 45分钟, 60分钟 -->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Button x:Name="Common30MinBtn" Width="70" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
BorderThickness="0" Click="Common30Min_Click" Cursor="Hand" Margin="0,0,8,0">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="6">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Button.Template>
<TextBlock Text="30:00" FontSize="12" FontWeight="Bold"
Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
</Button>
<Button x:Name="Common45MinBtn" Width="70" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
BorderThickness="0" Click="Common45Min_Click" Cursor="Hand" Margin="0,0,8,0">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="6">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Button.Template>
<TextBlock Text="45:00" FontSize="12" FontWeight="Bold"
Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
</Button>
<Button x:Name="Common60MinBtn" Width="70" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
BorderThickness="0" Click="Common60Min_Click" Cursor="Hand">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="6">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Button.Template>
<TextBlock Text="60:00" FontSize="12" FontWeight="Bold"
Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
</Button>
</StackPanel>
</StackPanel>
</Grid>
<!-- 最近计时区域 -->
<Grid x:Name="RecentTimersGrid" Visibility="Collapsed">
<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
<!-- 第一排:最近3个 -->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,0,0,10">
<Button x:Name="RecentTimer1Btn" Width="70" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
BorderThickness="0" Click="RecentTimer1_Click" Cursor="Hand" Margin="0,0,8,0">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="6">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Button.Template>
<TextBlock x:Name="RecentTimer1Text" Text="--:--" FontSize="12" FontWeight="Bold"
Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
</Button>
<Button x:Name="RecentTimer2Btn" Width="70" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
BorderThickness="0" Click="RecentTimer2_Click" Cursor="Hand" Margin="0,0,8,0">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="6">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Button.Template>
<TextBlock x:Name="RecentTimer2Text" Text="--:--" FontSize="12" FontWeight="Bold"
Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
</Button>
<Button x:Name="RecentTimer3Btn" Width="70" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
BorderThickness="0" Click="RecentTimer3_Click" Cursor="Hand">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="6">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Button.Template>
<TextBlock x:Name="RecentTimer3Text" Text="--:--" FontSize="12" FontWeight="Bold"
Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
</Button>
</StackPanel>
<!-- 第二排:最近3个 -->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Button x:Name="RecentTimer4Btn" Width="70" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
BorderThickness="0" Click="RecentTimer4_Click" Cursor="Hand" Margin="0,0,8,0">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="6">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Button.Template>
<TextBlock x:Name="RecentTimer4Text" Text="--:--" FontSize="12" FontWeight="Bold"
Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
</Button>
<Button x:Name="RecentTimer5Btn" Width="70" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
BorderThickness="0" Click="RecentTimer5_Click" Cursor="Hand" Margin="0,0,8,0">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="6">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Button.Template>
<TextBlock x:Name="RecentTimer5Text" Text="--:--" FontSize="12" FontWeight="Bold"
Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
</Button>
<Button x:Name="RecentTimer6Btn" Width="70" Height="40" Background="{DynamicResource SeewoTimerWindowButtonBackground}"
BorderThickness="0" Click="RecentTimer6_Click" Cursor="Hand">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="6">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Button.Template>
<TextBlock x:Name="RecentTimer6Text" Text="--:--" FontSize="12" FontWeight="Bold"
Foreground="{DynamicResource SeewoTimerWindowButtonForeground}"/>
</Button>
</StackPanel>
</StackPanel>
</Grid>
</StackPanel>
</Grid>
</Grid>