feat: change hand length.

This commit is contained in:
rabbitism
2024-04-23 22:02:17 +08:00
parent db6ba785dd
commit 823bb2ee8c
2 changed files with 34 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:iri="https://irihi.tech/shared"
xmlns:converter="clr-namespace:Ursa.Themes.Semi.Converters"
xmlns:u="https://irihi.tech/ursa">
<!-- Add Resources Here -->
<ControlTheme x:Key="{x:Type u:Clock}" TargetType="u:Clock">
@@ -18,8 +18,8 @@
<UniformGrid Rows="2" IsVisible="{TemplateBinding ShowHourHand}">
<Border
Width="16"
Margin="0,16,0,0"
VerticalAlignment="Stretch"
Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Bounds.Width, Converter={x:Static converter:ClockHandLengthConverter.Hour}}"
VerticalAlignment="Bottom"
Background="{TemplateBinding HandBrush}"
CornerRadius="8" />
<UniformGrid.RenderTransform>
@@ -29,8 +29,8 @@
<UniformGrid Rows="2" IsVisible="{TemplateBinding ShowMinuteHand}">
<Border
Width="8"
Margin="0,8,0,0"
VerticalAlignment="Stretch"
Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Bounds.Width, Converter={x:Static converter:ClockHandLengthConverter.Minute}}"
VerticalAlignment="Bottom"
Background="{TemplateBinding HandBrush}"
CornerRadius="4" />
<UniformGrid.RenderTransform>
@@ -40,8 +40,8 @@
<UniformGrid Rows="2" IsVisible="{TemplateBinding ShowSecondHand}">
<Border
Width="4"
Margin="0,4,0,0"
VerticalAlignment="Stretch"
Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Bounds.Width, Converter={x:Static converter:ClockHandLengthConverter.Second}}"
VerticalAlignment="Bottom"
Background="{TemplateBinding HandBrush}"
CornerRadius="4" />
<UniformGrid.RenderTransform>