|
|
@@ -3,77 +3,136 @@
|
|
|
xmlns="https://github.com/avaloniaui"
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
|
<ControlTheme TargetType="CheckBox" x:Key="{x:Type CheckBox}">
|
|
|
- <Setter Property="Foreground" Value="{DynamicResource MainTextColor}" />
|
|
|
- <Setter Property="Background" Value="{DynamicResource MainBackgroundColor}" />
|
|
|
- <Setter Property="BorderBrush" Value="{DynamicResource MainBorderColor}" />
|
|
|
- <Setter Property="BorderThickness" Value="1" />
|
|
|
- <Setter Property="Padding" Value="4,0,0,0" />
|
|
|
+ <Setter Property="Padding" Value="4" />
|
|
|
+ <Setter Property="HorizontalContentAlignment" Value="Center" />
|
|
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
|
|
- <Setter Property="HorizontalContentAlignment" Value="Left" />
|
|
|
<Setter Property="Template">
|
|
|
- <ControlTemplate>
|
|
|
- <Grid ColumnDefinitions="Auto,*">
|
|
|
- <Border
|
|
|
- Background="{TemplateBinding Background}"
|
|
|
- BorderBrush="{DynamicResource MainBorderColor}"
|
|
|
- BorderThickness="1"
|
|
|
- CornerRadius="{TemplateBinding CornerRadius}"
|
|
|
- Height="18"
|
|
|
- Name="border"
|
|
|
- VerticalAlignment="Center"
|
|
|
- Width="18">
|
|
|
- <Panel>
|
|
|
- <Path
|
|
|
- Data="M 1145.607177734375,430 C1145.607177734375,430 1141.449951171875,435.0772705078125 1141.449951171875,435.0772705078125 1141.449951171875,435.0772705078125 1139.232177734375,433.0999755859375 1139.232177734375,433.0999755859375 1139.232177734375,433.0999755859375 1138,434.5538330078125 1138,434.5538330078125 1138,434.5538330078125 1141.482177734375,438 1141.482177734375,438 1141.482177734375,438 1141.96875,437.9375 1141.96875,437.9375 1141.96875,437.9375 1147,431.34619140625 1147,431.34619140625 1147,431.34619140625 1145.607177734375,430 1145.607177734375,430 z"
|
|
|
- Fill="{DynamicResource AccentColor}"
|
|
|
- FlowDirection="LeftToRight"
|
|
|
- Height="10"
|
|
|
- HorizontalAlignment="Center"
|
|
|
- Name="checkMark"
|
|
|
- Stretch="Uniform"
|
|
|
- VerticalAlignment="Center"
|
|
|
- Width="11" />
|
|
|
- <Rectangle
|
|
|
- Fill="{DynamicResource AccentColor}"
|
|
|
- Height="10"
|
|
|
- HorizontalAlignment="Center"
|
|
|
- Name="indeterminateMark"
|
|
|
- Stretch="Uniform"
|
|
|
- VerticalAlignment="Center"
|
|
|
- Width="10" />
|
|
|
- </Panel>
|
|
|
- </Border>
|
|
|
- <ContentPresenter
|
|
|
- Content="{TemplateBinding Content}"
|
|
|
- ContentTemplate="{TemplateBinding ContentTemplate}"
|
|
|
- Grid.Column="1"
|
|
|
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
|
- IsVisible="{TemplateBinding Content,
|
|
|
- Converter={x:Static ObjectConverters.IsNotNull}}"
|
|
|
- Margin="{TemplateBinding Padding}"
|
|
|
- Name="PART_ContentPresenter"
|
|
|
- RecognizesAccessKey="True"
|
|
|
- TextElement.Foreground="{TemplateBinding Foreground}"
|
|
|
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
|
|
|
- </Grid>
|
|
|
+ <ControlTemplate TargetType="{x:Type CheckBox}">
|
|
|
+ <Border
|
|
|
+ Background="{TemplateBinding Background}"
|
|
|
+ BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
+ BorderThickness="{TemplateBinding BorderThickness}"
|
|
|
+ CornerRadius="{TemplateBinding CornerRadius}"
|
|
|
+ Name="border"
|
|
|
+ Padding="{TemplateBinding Padding}">
|
|
|
+ <StackPanel Orientation="Horizontal">
|
|
|
+ <Decorator
|
|
|
+ HorizontalAlignment="Center"
|
|
|
+ Margin="{TemplateBinding Padding}"
|
|
|
+ VerticalAlignment="Center">
|
|
|
+
|
|
|
+ <Canvas Height="20" Width="20">
|
|
|
+ <Image
|
|
|
+ Height="18"
|
|
|
+ IsVisible="False"
|
|
|
+ Source="{StaticResource SquareCheckImage}"
|
|
|
+ Width="18"
|
|
|
+ x:Name="TickMark" />
|
|
|
+
|
|
|
+ <Image
|
|
|
+ Height="18"
|
|
|
+ Source="{StaticResource SquareImage}"
|
|
|
+ Stretch="Fill"
|
|
|
+ Width="18"
|
|
|
+ x:Name="CrossMark" />
|
|
|
+ </Canvas>
|
|
|
+ </Decorator>
|
|
|
+ <ContentPresenter
|
|
|
+ Content="{TemplateBinding Content}"
|
|
|
+ ContentTemplate="{TemplateBinding ContentTemplate}"
|
|
|
+ HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
|
+ Name="PART_ContentPresenter"
|
|
|
+ RecognizesAccessKey="True"
|
|
|
+ TextElement.Foreground="{TemplateBinding Foreground}"
|
|
|
+ VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
|
|
|
+ </StackPanel>
|
|
|
+ </Border>
|
|
|
</ControlTemplate>
|
|
|
</Setter>
|
|
|
- <Style Selector="^:pointerover /template/ Border#border">
|
|
|
- <Setter Property="BorderBrush" Value="{DynamicResource SecondaryBorderColor}" />
|
|
|
+
|
|
|
+ <Style Selector="^:checked">
|
|
|
+ <Style Selector="^ /template/ Image#TickMark">
|
|
|
+ <Setter Property="IsVisible" Value="True" />
|
|
|
+ </Style>
|
|
|
+ <Style Selector="^ /template/ Image#CrossMark">
|
|
|
+ <Setter Property="IsVisible" Value="False" />
|
|
|
+ </Style>
|
|
|
+ </Style>
|
|
|
+
|
|
|
+ <Style Selector="^:unchecked">
|
|
|
+ <Style Selector="^ /template/ Image#TickMark">
|
|
|
+ <Setter Property="IsVisible" Value="False" />
|
|
|
+ </Style>
|
|
|
+ <Style Selector="^ /template/ Image#CrossMark">
|
|
|
+ <Setter Property="IsVisible" Value="True" />
|
|
|
+ </Style>
|
|
|
</Style>
|
|
|
- <Style Selector="^ /template/ Path#checkMark">
|
|
|
- <Setter Property="IsVisible" Value="False" />
|
|
|
+
|
|
|
+ <Style Selector="^.hover:pointerover /template/ Border#border">
|
|
|
+ <Style.Animations>
|
|
|
+ <Animation Duration="{StaticResource ButtonHoverAnimationDuration}" IterationCount="1">
|
|
|
+ <KeyFrame>
|
|
|
+ <Setter Property="Background">
|
|
|
+ <SolidColorBrush Color="{DynamicResource SecondaryBackgroundColor}" />
|
|
|
+ </Setter>
|
|
|
+ </KeyFrame>
|
|
|
+ <KeyFrame Cue="1">
|
|
|
+ <Setter Property="Background">
|
|
|
+ <SolidColorBrush Color="{DynamicResource AccentColor}" />
|
|
|
+ </Setter>
|
|
|
+ </KeyFrame>
|
|
|
+ </Animation>
|
|
|
+ </Style.Animations>
|
|
|
+ <Setter Property="Background" Value="{DynamicResource AccentColor}" />
|
|
|
+ </Style>
|
|
|
+ <Style Selector="^.altHover:pointerover /template/ Border#border">
|
|
|
+ <Style.Animations>
|
|
|
+ <Animation Duration="{StaticResource ButtonHoverAnimationDuration}" IterationCount="1">
|
|
|
+ <KeyFrame>
|
|
|
+ <Setter Property="Background">
|
|
|
+ <SolidColorBrush Color="{DynamicResource SecondaryBackgroundColor}" />
|
|
|
+ </Setter>
|
|
|
+ <Setter Property="BorderBrush">
|
|
|
+ <SolidColorBrush Color="{DynamicResource OuterBorderColor}" />
|
|
|
+ </Setter>
|
|
|
+ </KeyFrame>
|
|
|
+ <KeyFrame Cue="1">
|
|
|
+ <Setter Property="Background">
|
|
|
+ <SolidColorBrush Color="{DynamicResource AltBackgroundHoverColor}" />
|
|
|
+ </Setter>
|
|
|
+ <Setter Property="BorderBrush">
|
|
|
+ <SolidColorBrush Color="{DynamicResource SecondaryBorderColor}" />
|
|
|
+ </Setter>
|
|
|
+ </KeyFrame>
|
|
|
+ </Animation>
|
|
|
+ </Style.Animations>
|
|
|
+ <Setter Property="Background" Value="{DynamicResource AltBackgroundHoverColor}" />
|
|
|
+ <Setter Property="BorderBrush" Value="{DynamicResource SecondaryBorderColor}" />
|
|
|
</Style>
|
|
|
- <Style Selector="^ /template/ Rectangle#indeterminateMark">
|
|
|
- <Setter Property="IsVisible" Value="False" />
|
|
|
+ <Style Selector="^.noBorderHover:pointerover /template/ Border#border">
|
|
|
+ <Style.Animations>
|
|
|
+ <Animation Duration="{StaticResource ButtonHoverAnimationDuration}" IterationCount="1">
|
|
|
+ <KeyFrame>
|
|
|
+ <Setter Property="Background">
|
|
|
+ <SolidColorBrush Color="Transparent" />
|
|
|
+ </Setter>
|
|
|
+ </KeyFrame>
|
|
|
+ <KeyFrame Cue="1">
|
|
|
+ <Setter Property="Background">
|
|
|
+ <SolidColorBrush Color="{DynamicResource AltBackgroundHoverColor}" />
|
|
|
+ </Setter>
|
|
|
+ </KeyFrame>
|
|
|
+ </Animation>
|
|
|
+ </Style.Animations>
|
|
|
+ <Setter Property="Background" Value="{DynamicResource AltBackgroundHoverColor}" />
|
|
|
</Style>
|
|
|
- <Style Selector="^:checked /template/ Path#checkMark">
|
|
|
- <Setter Property="IsVisible" Value="True" />
|
|
|
+ <Style Selector="^.hover:pressed /template/ ContentPresenter#PART_ContentPresenter">
|
|
|
+ <Setter Property="Background" Value="{DynamicResource SecondaryAccentColor}" />
|
|
|
</Style>
|
|
|
- <Style Selector="^:indeterminate /template/ Rectangle#indeterminateMark">
|
|
|
- <Setter Property="IsVisible" Value="True" />
|
|
|
+ <Style Selector="^.noBorderHover:pressed /template/ ContentPresenter#PART_ContentPresenter">
|
|
|
+ <Setter Property="Background" Value="{DynamicResource SecondaryAccentColor}" />
|
|
|
</Style>
|
|
|
- <Style Selector="^:disabled /template/ Border#border">
|
|
|
+ <Style Selector="^:disabled">
|
|
|
<Setter Property="Opacity" Value="{DynamicResource ThemeDisabledOpacity}" />
|
|
|
</Style>
|
|
|
</ControlTheme>
|