修改单选按钮组样式

This commit is contained in:
zengwenjie
2025-12-25 09:51:57 +08:00
parent 59e2e02f8a
commit 537b4ed186
2 changed files with 74 additions and 5 deletions

View File

@@ -99,11 +99,11 @@
</ComboBox>
</HeaderedContentControl>
<HeaderedContentControl DockPanel.Dock="Top" Height="40" Background="{DynamicResource BGOddRow}" Header="作战意图选择" Style="{DynamicResource HCC_PropertyEditor}">
<UniformGrid Rows="1">
<RadioButton Content="不限意图" Style="{DynamicResource RadioButton_Item}" IsChecked="True"/>
<RadioButton Content="自卫突防" Style="{DynamicResource RadioButton_Item}"/>
<RadioButton Content="支援干扰" Style="{DynamicResource RadioButton_Item}"/>
<RadioButton Content="伴随干扰" Style="{DynamicResource RadioButton_Item}"/>
<UniformGrid Rows="1" VerticalAlignment="Center" Height="30">
<RadioButton Content="不限意图" Style="{DynamicResource RadioButton_OptionLeft}" IsChecked="True"/>
<RadioButton Content="自卫突防" Style="{DynamicResource RadioButton_Option}"/>
<RadioButton Content="支援干扰" Style="{DynamicResource RadioButton_Option}"/>
<RadioButton Content="伴随干扰" Style="{DynamicResource RadioButton_OptionRight}"/>
</UniformGrid>
</HeaderedContentControl>
<HeaderedContentControl DockPanel.Dock="Top" MinHeight="40" Background="{DynamicResource BGEvenRow}" Style="{DynamicResource HCC_PropertyEditor}">

View File

@@ -38,6 +38,75 @@
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="RadioButton_OptionLeft" TargetType="{x:Type RadioButton}">
<Setter Property="BorderBrush" Value="{DynamicResource BGTitle}"/>
<Setter Property="BorderThickness" Value="1,1,0.5,1"/>
<Setter Property="Background" Value="{DynamicResource BGHeader}"/>
<Setter Property="Foreground" Value="{DynamicResource FGHeader}"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type RadioButton}">
<Border CornerRadius="15,0,0,15" Padding="15,0,15,0" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="Background" Value="{DynamicResource BGTitle}"/>
<Setter Property="Foreground" Value="{DynamicResource FGHighlight}"/>
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="RadioButton_Option" TargetType="{x:Type RadioButton}">
<Setter Property="BorderBrush" Value="{DynamicResource BGTitle}"/>
<Setter Property="BorderThickness" Value="0.5,1,0.5,1"/>
<Setter Property="Background" Value="{DynamicResource BGHeader}"/>
<Setter Property="Foreground" Value="{DynamicResource FGHeader}"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type RadioButton}">
<Border Padding="15,0,15,0" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="Background" Value="{DynamicResource BGTitle}"/>
<Setter Property="Foreground" Value="{DynamicResource FGHighlight}"/>
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="RadioButton_OptionRight" TargetType="{x:Type RadioButton}">
<Setter Property="BorderBrush" Value="{DynamicResource BGTitle}"/>
<Setter Property="BorderThickness" Value="0.5,1,1,1"/>
<Setter Property="Background" Value="{DynamicResource BGHeader}"/>
<Setter Property="Foreground" Value="{DynamicResource FGHeader}"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type RadioButton}">
<Border CornerRadius="0,15,15,0" Padding="15,0,15,0" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="Background" Value="{DynamicResource BGTitle}"/>
<Setter Property="Foreground" Value="{DynamicResource FGHighlight}"/>
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="RadioButton_Item" TargetType="{x:Type RadioButton}">
<Setter Property="Background" Value="{DynamicResource BGHyaline}"/>
<Setter Property="BorderBrush" Value="{DynamicResource FGKeynote}"/>