Files

123 lines
6.3 KiB
XML
Raw Permalink Normal View History

2025-11-29 16:27:35 +08:00
<UserControl x:Class="Ink_Canvas.Windows.MinimizedTimerControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="200" d:DesignWidth="600">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="DigitResources.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Border x:Name="MainBorder" Background="{DynamicResource NewTimerWindowBackground}"
CornerRadius="15"
BorderThickness="1"
BorderBrush="{DynamicResource NewTimerWindowBorderBrush}"
Margin="0"
UseLayoutRounding="True"
SnapsToDevicePixels="True"
MouseLeftButtonDown="MainBorder_MouseLeftButtonDown"
Cursor="Hand">
<Grid>
<!-- 时间显示 -->
<Grid HorizontalAlignment="Center" VerticalAlignment="Center" Margin="20,20,20,20">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<!-- 小时 -->
<Path x:Name="MinHour1Display" Data="{StaticResource Digit0}"
Fill="{DynamicResource NewTimerWindowDigitForeground}"
Width="72" Height="72"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Stretch="Uniform"
Margin="0,0,12,0"/>
<Path x:Name="MinHour2Display" Data="{StaticResource Digit0}"
Fill="{DynamicResource NewTimerWindowDigitForeground}"
Width="72" Height="72"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Stretch="Uniform"
Margin="0,0,12,0"/>
<!-- 冒号 -->
<TextBlock x:Name="MinColon1Display" Text=":" FontSize="48" FontWeight="Bold"
Foreground="{DynamicResource NewTimerWindowDigitForeground}"
HorizontalAlignment="Center" VerticalAlignment="Center"
Margin="0,0,12,0"/>
<!-- 分钟 -->
<Path x:Name="MinMinute1Display" Data="{StaticResource Digit0}"
Fill="{DynamicResource NewTimerWindowDigitForeground}"
Width="72" Height="72"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Stretch="Uniform"
Margin="0,0,12,0"/>
<Path x:Name="MinMinute2Display" Data="{StaticResource Digit0}"
Fill="{DynamicResource NewTimerWindowDigitForeground}"
Width="72" Height="72"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Stretch="Uniform"
Margin="0,0,12,0"/>
<!-- 冒号 -->
<TextBlock x:Name="MinColon2Display" Text=":" FontSize="48" FontWeight="Bold"
Foreground="{DynamicResource NewTimerWindowDigitForeground}"
HorizontalAlignment="Center" VerticalAlignment="Center"
Margin="0,0,12,0"/>
<!---->
<Path x:Name="MinSecond1Display" Data="{StaticResource Digit0}"
Fill="{DynamicResource NewTimerWindowDigitForeground}"
Width="72" Height="72"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Stretch="Uniform"
Margin="0,0,12,0"/>
<Path x:Name="MinSecond2Display" Data="{StaticResource Digit0}"
Fill="{DynamicResource NewTimerWindowDigitForeground}"
Width="72" Height="72"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Stretch="Uniform"
Margin="0,0,0,0"/>
</StackPanel>
</Grid>
<!-- 关闭按钮 -->
<Button x:Name="CloseButton"
Width="24" Height="24"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Margin="0,8,8,0"
Background="Transparent"
BorderThickness="0"
Click="CloseButton_Click"
Cursor="Hand"
Opacity="0.7">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" CornerRadius="12">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#E81123"/>
<Setter Property="Foreground" Value="White"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
<TextBlock Text="✕" FontSize="12" FontWeight="Bold"
Foreground="{DynamicResource NewTimerWindowButtonForeground}"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
</Grid>
</Border>
</UserControl>