Files
community/Ink Canvas/Windows/MinimizedTimerWindow.xaml
T
2025-10-06 20:33:50 +08:00

126 lines
6.5 KiB
XML

<Window x:Class="Ink_Canvas.MinimizedTimerWindow"
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"
xmlns:local="clr-namespace:Ink_Canvas"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
Topmost="True" Background="Transparent"
mc:Ignorable="d" WindowStyle="None" AllowsTransparency="True"
WindowStartupLocation="Manual" Title="计时器" Height="200" Width="600"
MouseLeftButtonDown="Window_MouseLeftButtonDown" MouseLeftButtonUp="Window_MouseLeftButtonUp"
MouseEnter="Window_MouseEnter" MouseLeave="Window_MouseLeave" MouseMove="Window_MouseMove">
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="DigitResources.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
<Border Background="{DynamicResource SeewoTimerWindowBackground}"
CornerRadius="15"
BorderThickness="1"
BorderBrush="{DynamicResource SeewoTimerWindowBorderBrush}"
Margin="0"
UseLayoutRounding="True"
SnapsToDevicePixels="True">
<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 SeewoTimerWindowDigitForeground}"
Width="72" Height="72"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Stretch="Uniform"
Margin="0,0,12,0"/>
<Path x:Name="MinHour2Display" Data="{StaticResource Digit0}"
Fill="{DynamicResource SeewoTimerWindowDigitForeground}"
Width="72" Height="72"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Stretch="Uniform"
Margin="0,0,12,0"/>
<!-- 冒号 -->
<TextBlock Text=":" FontSize="48" FontWeight="Bold"
Foreground="{DynamicResource SeewoTimerWindowDigitForeground}"
HorizontalAlignment="Center" VerticalAlignment="Center"
Margin="0,0,12,0"/>
<!-- 分钟 -->
<Path x:Name="MinMinute1Display" Data="{StaticResource Digit0}"
Fill="{DynamicResource SeewoTimerWindowDigitForeground}"
Width="72" Height="72"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Stretch="Uniform"
Margin="0,0,12,0"/>
<Path x:Name="MinMinute2Display" Data="{StaticResource Digit0}"
Fill="{DynamicResource SeewoTimerWindowDigitForeground}"
Width="72" Height="72"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Stretch="Uniform"
Margin="0,0,12,0"/>
<!-- 冒号 -->
<TextBlock Text=":" FontSize="48" FontWeight="Bold"
Foreground="{DynamicResource SeewoTimerWindowDigitForeground}"
HorizontalAlignment="Center" VerticalAlignment="Center"
Margin="0,0,12,0"/>
<!---->
<Path x:Name="MinSecond1Display" Data="{StaticResource Digit0}"
Fill="{DynamicResource SeewoTimerWindowDigitForeground}"
Width="72" Height="72"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Stretch="Uniform"
Margin="0,0,12,0"/>
<Path x:Name="MinSecond2Display" Data="{StaticResource Digit0}"
Fill="{DynamicResource SeewoTimerWindowDigitForeground}"
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 SeewoTimerWindowButtonForeground}"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
</Grid>
</Border>
</Window>