This commit is contained in:
ShrlAlgo
2025-07-11 09:20:23 +08:00
parent c7b104f44f
commit 4d35cadb56
840 changed files with 102347 additions and 11595 deletions

View File

@@ -1,17 +1,7 @@
<!--
This Source Code Form is subject to the terms of the MIT License.
If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
Copyright (C) Leszek Pomianowski and WPF UI Contributors.
All Rights Reserved.
Based on Microsoft XAML for Win UI
Copyright (c) Microsoft Corporation. All Rights Reserved.
-->
<ResourceDictionary
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<system:Double x:Key="RadioButtonCheckGlyphSize">12</system:Double>
<system:Double x:Key="RadioButtonOuterEllipseSize">20</system:Double>
@@ -21,14 +11,14 @@
<system:Double x:Key="RadioButtonStrokeThickness">1</system:Double>
<Thickness x:Key="RadioButtonPadding">8,6,0,0</Thickness>
<Style x:Key="DefaultRadioButtonStyle" TargetType="{x:Type RadioButton}">
<Style TargetType="{x:Type RadioButton}" x:Key="DefaultRadioButtonStyle">
<!-- Universal WPF UI focus -->
<Setter Property="FocusVisualStyle" Value="{DynamicResource DefaultControlFocusVisualStyle}" />
<!-- Universal WPF UI focus -->
<Setter Property="Background" Value="{DynamicResource RadioButtonOuterEllipseCheckedStroke}" />
<Setter Property="Foreground" Value="{DynamicResource RadioButtonForeground}" />
<Setter Property="Background" Value="{DynamicResource SystemFillColorAttentionBrush}" />
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="Margin" Value="0" />
<Setter Property="Margin" Value="4,0" />
<Setter Property="Padding" Value="{StaticResource RadioButtonPadding}" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="HorizontalAlignment" Value="Left" />
@@ -37,7 +27,6 @@
<Setter Property="VerticalContentAlignment" Value="Top" />
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="MinWidth" Value="120" />
<Setter Property="KeyboardNavigation.IsTabStop" Value="True" />
<Setter Property="Focusable" Value="True" />
<Setter Property="SnapsToDevicePixels" Value="True" />
@@ -46,65 +35,65 @@
<Setter.Value>
<ControlTemplate TargetType="{x:Type RadioButton}">
<Grid
Background="Transparent"
HorizontalAlignment="Stretch"
VerticalAlignment="{TemplateBinding VerticalAlignment}"
Background="Transparent">
VerticalAlignment="{TemplateBinding VerticalAlignment}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="20" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid Height="32" VerticalAlignment="Top">
<Ellipse
x:Name="OuterEllipse"
Width="{StaticResource RadioButtonOuterEllipseSize}"
Fill="{DynamicResource ControlAltFillColorSecondaryBrush}"
Height="{StaticResource RadioButtonOuterEllipseSize}"
Fill="{DynamicResource RadioButtonOuterEllipseFill}"
Stroke="{DynamicResource RadioButtonOuterEllipseStroke}"
Stroke="{DynamicResource ControlStrongStrokeColorDefaultBrush}"
StrokeThickness="{StaticResource RadioButtonStrokeThickness}"
UseLayoutRounding="False" />
UseLayoutRounding="False"
Width="{StaticResource RadioButtonOuterEllipseSize}"
x:Name="OuterEllipse" />
<!-- A separate element is added since the two orthogonal state groups that cannot touch the same property -->
<Ellipse
x:Name="CheckOuterEllipse"
Width="{StaticResource RadioButtonOuterEllipseSize}"
Height="{StaticResource RadioButtonOuterEllipseSize}"
Fill="{TemplateBinding Background}"
Height="{StaticResource RadioButtonOuterEllipseSize}"
Opacity="0"
Stroke="{TemplateBinding Background}"
StrokeThickness="{StaticResource RadioButtonStrokeThickness}"
UseLayoutRounding="False" />
UseLayoutRounding="False"
Width="{StaticResource RadioButtonOuterEllipseSize}"
x:Name="CheckOuterEllipse" />
<Ellipse
x:Name="CheckGlyph"
Width="{StaticResource RadioButtonCheckGlyphSize}"
Fill="{DynamicResource TextOnAccentFillColorPrimaryBrush}"
Height="{StaticResource RadioButtonCheckGlyphSize}"
Fill="{DynamicResource RadioButtonCheckGlyphFill}"
Opacity="0"
Stroke="{DynamicResource CircleElevationBorderBrush}"
UseLayoutRounding="False">
UseLayoutRounding="False"
Width="{StaticResource RadioButtonCheckGlyphSize}"
x:Name="CheckGlyph">
<Ellipse.LayoutTransform>
<ScaleTransform ScaleX="1.0" ScaleY="1.0" />
</Ellipse.LayoutTransform>
</Ellipse>
<!-- A separate element is added since the two orthogonal state groups that cannot touch the same property -->
<Border
x:Name="PressedCheckGlyph"
Width="4"
Height="4"
Background="{DynamicResource RadioButtonCheckGlyphFill}"
Background="{DynamicResource TextOnAccentFillColorPrimaryBrush}"
BorderBrush="{DynamicResource CircleElevationBorderBrush}"
CornerRadius="6"
Height="4"
Opacity="0"
UseLayoutRounding="False" />
UseLayoutRounding="False"
Width="4"
x:Name="PressedCheckGlyph" />
</Grid>
<ContentPresenter
x:Name="ContentPresenter"
Grid.Column="1"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
TextElement.Foreground="{TemplateBinding Foreground}" />
Grid.Column="1"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
TextElement.Foreground="{TemplateBinding Foreground}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
x:Name="ContentPresenter" />
</Grid>
<ControlTemplate.Triggers>
<!-- Clunky, todo
@@ -158,15 +147,15 @@
<Condition Property="IsChecked" Value="False" />
<Condition Property="IsEnabled" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="CheckGlyph" Property="Opacity" Value="1.0" />
<Setter TargetName="OuterEllipse" Property="Fill" Value="{DynamicResource RadioButtonOuterEllipseFillPressed}" />
<Setter TargetName="OuterEllipse" Property="Stroke" Value="{DynamicResource RadioButtonOuterEllipseStrokePressed}" />
<Setter Property="Opacity" TargetName="CheckGlyph" Value="1.0" />
<Setter Property="Fill" TargetName="OuterEllipse" Value="{DynamicResource ControlAltFillColorQuarternaryBrush}" />
<Setter Property="Stroke" TargetName="OuterEllipse" Value="{DynamicResource ControlStrongStrokeColorDisabledBrush}" />
</MultiTrigger>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="CheckGlyph" Property="Opacity" Value="1.0" />
<Setter TargetName="OuterEllipse" Property="Opacity" Value="0.0" />
<Setter TargetName="CheckOuterEllipse" Property="Opacity" Value="1.0" />
<Setter Property="Opacity" TargetName="CheckGlyph" Value="1.0" />
<Setter Property="Opacity" TargetName="OuterEllipse" Value="0.0" />
<Setter Property="Opacity" TargetName="CheckOuterEllipse" Value="1.0" />
</Trigger>
<Trigger Property="FlowDirection" Value="RightToLeft">
<Setter Property="HorizontalAlignment" Value="Right" />
@@ -177,7 +166,7 @@
<Condition Property="IsChecked" Value="False" />
<Condition Property="IsEnabled" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="OuterEllipse" Property="Fill" Value="{DynamicResource RadioButtonOuterEllipseFillPointerOver}" />
<Setter Property="Fill" TargetName="OuterEllipse" Value="{DynamicResource ControlAltFillColorTertiaryBrush}" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
@@ -185,32 +174,32 @@
<Condition Property="IsChecked" Value="True" />
<Condition Property="IsEnabled" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="OuterEllipse" Property="Fill" Value="{DynamicResource RadioButtonOuterEllipseFillPointerOver}" />
<!--<Setter TargetName="CheckGlyph" Property="Fill" Value="{DynamicResource RadioButtonOuterEllipseCheckedStrokePointerOver}" />-->
<Setter TargetName="PressedCheckGlyph" Property="Background" Value="{DynamicResource RadioButtonOuterEllipseCheckedStrokePointerOver}" />
<Setter Property="Fill" TargetName="OuterEllipse" Value="{DynamicResource ControlAltFillColorTertiaryBrush}" />
<!--<Setter TargetName="CheckGlyph" Property="Fill" Value="{DynamicResource SystemFillColorAttentionBrush}" />-->
<Setter Property="Background" TargetName="PressedCheckGlyph" Value="{DynamicResource SystemFillColorAttentionBrush}" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsChecked" Value="False" />
<Condition Property="IsEnabled" Value="False" />
</MultiTrigger.Conditions>
<Setter Property="Foreground" Value="{DynamicResource RadioButtonForegroundDisabled}" />
<Setter TargetName="OuterEllipse" Property="Fill" Value="{DynamicResource RadioButtonOuterEllipseFillDisabled}" />
<Setter TargetName="OuterEllipse" Property="Stroke" Value="{DynamicResource RadioButtonOuterEllipseStrokeDisabled}" />
<Setter Property="Foreground" Value="{DynamicResource TextFillColorDisabledBrush}" />
<Setter Property="Fill" TargetName="OuterEllipse" Value="{DynamicResource ControlAltFillColorDisabledBrush}" />
<Setter Property="Stroke" TargetName="OuterEllipse" Value="{DynamicResource ControlStrongStrokeColorDisabledBrush}" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsChecked" Value="True" />
<Condition Property="IsEnabled" Value="False" />
</MultiTrigger.Conditions>
<Setter Property="Foreground" Value="{DynamicResource RadioButtonForegroundDisabled}" />
<Setter Property="Foreground" Value="{DynamicResource RadioButtonForegroundDisabled}" />
<Setter TargetName="OuterEllipse" Property="Fill" Value="{DynamicResource RadioButtonOuterEllipseFillDisabled}" />
<Setter TargetName="OuterEllipse" Property="Stroke" Value="{DynamicResource RadioButtonOuterEllipseCheckedStrokeDisabled}" />
<Setter Property="Foreground" Value="{DynamicResource TextFillColorDisabledBrush}" />
<Setter Property="Foreground" Value="{DynamicResource TextFillColorDisabledBrush}" />
<Setter Property="Fill" TargetName="OuterEllipse" Value="{DynamicResource ControlAltFillColorDisabledBrush}" />
<Setter Property="Stroke" TargetName="OuterEllipse" Value="{DynamicResource RadioButtonOuterEllipseCheckedStrokeDisabled}" />
<Setter TargetName="CheckGlyph" Property="Opacity" Value="0.7" />
<Setter TargetName="CheckOuterEllipse" Property="Opacity" Value="0.7" />
<Setter Property="Opacity" TargetName="CheckGlyph" Value="0.7" />
<Setter Property="Opacity" TargetName="CheckOuterEllipse" Value="0.7" />
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>