mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-05-03 06:21:29 +08:00
feat: adjust CheckBox Border style.
This commit is contained in:
@@ -4,11 +4,11 @@
|
|||||||
x:CompileBindings="True">
|
x:CompileBindings="True">
|
||||||
<ControlTheme x:Key="{x:Type CheckBox}" TargetType="CheckBox">
|
<ControlTheme x:Key="{x:Type CheckBox}" TargetType="CheckBox">
|
||||||
<Setter Property="Padding" Value="8,0,0,0" />
|
<Setter Property="Padding" Value="8,0,0,0" />
|
||||||
<Setter Property="VerticalAlignment" Value="Center" />
|
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
<Setter Property="VerticalAlignment" Value="Top" />
|
||||||
|
<Setter Property="Cursor" Value="Hand" />
|
||||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||||
<Setter Property="Cursor" Value="Hand" />
|
|
||||||
<Setter Property="FontSize" Value="{DynamicResource CheckBoxFontSize}" />
|
<Setter Property="FontSize" Value="{DynamicResource CheckBoxFontSize}" />
|
||||||
<Setter Property="CornerRadius" Value="{DynamicResource CheckBoxBoxCornerRadius}" />
|
<Setter Property="CornerRadius" Value="{DynamicResource CheckBoxBoxCornerRadius}" />
|
||||||
<Setter Property="MinHeight" Value="32" />
|
<Setter Property="MinHeight" Value="32" />
|
||||||
@@ -17,50 +17,45 @@
|
|||||||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxDefaultBorderBrush}" />
|
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxDefaultBorderBrush}" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="CheckBox">
|
<ControlTemplate TargetType="CheckBox">
|
||||||
<Grid x:Name="RootGrid" ColumnDefinitions="Auto,*">
|
<Border
|
||||||
<Border
|
x:Name="RootBorder"
|
||||||
x:Name="PART_Border"
|
Background="{TemplateBinding Background}"
|
||||||
Grid.Column="0"
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
Grid.ColumnSpan="2"
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
HorizontalAlignment="Center"
|
CornerRadius="{TemplateBinding CornerRadius}">
|
||||||
Background="{TemplateBinding Background}"
|
<Grid x:Name="RootGrid" ColumnDefinitions="Auto,*">
|
||||||
BorderBrush="{TemplateBinding BorderBrush}"
|
<Grid
|
||||||
BorderThickness="{TemplateBinding BorderThickness}"
|
Grid.Column="0"
|
||||||
CornerRadius="{TemplateBinding CornerRadius}" />
|
Margin="0,0,0,0"
|
||||||
|
VerticalAlignment="Center">
|
||||||
<Grid
|
<Border
|
||||||
Grid.Column="0"
|
x:Name="NormalRectangle"
|
||||||
Margin="0,0,0,0"
|
Width="{DynamicResource CheckBoxBoxWidth}"
|
||||||
VerticalAlignment="Center">
|
Height="{DynamicResource CheckBoxBoxHeight}"
|
||||||
<Border
|
Background="{DynamicResource CheckBoxDefaultBackground}"
|
||||||
x:Name="NormalRectangle"
|
BorderBrush="{DynamicResource CheckBoxDefaultBorderBrush}"
|
||||||
Width="{DynamicResource CheckBoxBoxWidth}"
|
BorderThickness="{DynamicResource CheckBoxBoxBorderThickness}"
|
||||||
Height="{DynamicResource CheckBoxBoxHeight}"
|
CornerRadius="{TemplateBinding CornerRadius}"
|
||||||
Background="{DynamicResource CheckBoxDefaultBackground}"
|
UseLayoutRounding="False" />
|
||||||
BorderBrush="{DynamicResource CheckBoxDefaultBorderBrush}"
|
<PathIcon
|
||||||
BorderThickness="{DynamicResource CheckBoxBoxBorderThickness}"
|
Name="CheckGlyph"
|
||||||
CornerRadius="{TemplateBinding CornerRadius}"
|
Width="{DynamicResource CheckBoxBoxGlyphWidth}"
|
||||||
UseLayoutRounding="False" />
|
Height="{DynamicResource CheckBoxBoxGlyphHeight}"
|
||||||
<PathIcon
|
Foreground="{DynamicResource CheckBoxGlyphFill}" />
|
||||||
Name="CheckGlyph"
|
</Grid>
|
||||||
Width="{DynamicResource CheckBoxBoxGlyphWidth}"
|
<ContentPresenter
|
||||||
Height="{DynamicResource CheckBoxBoxGlyphHeight}"
|
x:Name="ContentPresenter"
|
||||||
Foreground="{DynamicResource CheckBoxGlyphFill}" />
|
Grid.Column="1"
|
||||||
|
Margin="{TemplateBinding Padding}"
|
||||||
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Content="{TemplateBinding Content}"
|
||||||
|
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||||
|
IsVisible="{TemplateBinding Content,Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||||
|
RecognizesAccessKey="True"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
</Grid>
|
</Grid>
|
||||||
<ContentPresenter
|
</Border>
|
||||||
x:Name="ContentPresenter"
|
|
||||||
Grid.Column="1"
|
|
||||||
Margin="{TemplateBinding Padding}"
|
|
||||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Content="{TemplateBinding Content}"
|
|
||||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
|
||||||
IsVisible="{TemplateBinding Content,
|
|
||||||
Converter={x:Static ObjectConverters.IsNotNull}}"
|
|
||||||
RecognizesAccessKey="True"
|
|
||||||
TextWrapping="Wrap" />
|
|
||||||
</Grid>
|
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter>
|
</Setter>
|
||||||
|
|
||||||
@@ -461,4 +456,4 @@
|
|||||||
</Style>
|
</Style>
|
||||||
</Style>
|
</Style>
|
||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@@ -24,6 +24,10 @@
|
|||||||
<Setter Property="RadioButton.HorizontalContentAlignment" Value="Left" />
|
<Setter Property="RadioButton.HorizontalContentAlignment" Value="Left" />
|
||||||
<Setter Property="RadioButton.VerticalContentAlignment" Value="Center" />
|
<Setter Property="RadioButton.VerticalContentAlignment" Value="Center" />
|
||||||
<Setter Property="RadioButton.FontSize" Value="{DynamicResource RadioButtonFontSize}" />
|
<Setter Property="RadioButton.FontSize" Value="{DynamicResource RadioButtonFontSize}" />
|
||||||
|
<Setter Property="RadioButton.CornerRadius" Value="{DynamicResource RadioButtonBoxCornerRadius}" />
|
||||||
|
<Setter Property="RadioButton.Foreground" Value="{DynamicResource RadioButtonForeground}" />
|
||||||
|
<Setter Property="RadioButton.Background" Value="{DynamicResource RadioButtonDefaultBackground}" />
|
||||||
|
<Setter Property="RadioButton.BorderBrush" Value="{DynamicResource RadioButtonDefaultBorderBrush}" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="RadioButton">
|
<ControlTemplate TargetType="RadioButton">
|
||||||
<Border
|
<Border
|
||||||
|
|||||||
@@ -32,6 +32,9 @@
|
|||||||
<SolidColorBrush x:Key="RadioButtonCheckGlyphFill" Color="White" />
|
<SolidColorBrush x:Key="RadioButtonCheckGlyphFill" Color="White" />
|
||||||
|
|
||||||
<SolidColorBrush x:Key="RadioButtonForeground" Color="#F9F9F9" />
|
<SolidColorBrush x:Key="RadioButtonForeground" Color="#F9F9F9" />
|
||||||
|
<SolidColorBrush x:Key="RadioButtonDefaultBackground" Color="Transparent" />
|
||||||
|
<SolidColorBrush x:Key="RadioButtonDefaultBorderBrush" Opacity="0.35" Color="#F9F9F9" />
|
||||||
|
<CornerRadius x:Key="RadioButtonBoxCornerRadius">3</CornerRadius>
|
||||||
|
|
||||||
<SolidColorBrush x:Key="RadioButtonGroupBackground" Opacity="0.12" Color="White" />
|
<SolidColorBrush x:Key="RadioButtonGroupBackground" Opacity="0.12" Color="White" />
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,9 @@
|
|||||||
<SolidColorBrush x:Key="RadioButtonCheckGlyphFill" Color="White" />
|
<SolidColorBrush x:Key="RadioButtonCheckGlyphFill" Color="White" />
|
||||||
|
|
||||||
<SolidColorBrush x:Key="RadioButtonForeground" Color="#1C1F23" />
|
<SolidColorBrush x:Key="RadioButtonForeground" Color="#1C1F23" />
|
||||||
|
<SolidColorBrush x:Key="RadioButtonDefaultBackground" Color="Transparent" />
|
||||||
|
<SolidColorBrush x:Key="RadioButtonDefaultBorderBrush" Opacity="0.35" Color="#1C1F23" />
|
||||||
|
<CornerRadius x:Key="RadioButtonBoxCornerRadius">3</CornerRadius>
|
||||||
|
|
||||||
<SolidColorBrush x:Key="RadioButtonGroupBackground" Opacity="0.05" Color="#2E3238" />
|
<SolidColorBrush x:Key="RadioButtonGroupBackground" Opacity="0.05" Color="#2E3238" />
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user