Skip to content

Commit 17b8ffb

Browse files
committed
fluent2 - fix check glyph type and size
1 parent f71d0b3 commit 17b8ffb

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/Avalonia.Themes.Fluent2/Controls/CheckBox.xaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@
1212
</Border>
1313
</Design.PreviewWith>
1414

15+
<StreamGeometry x:Key="CheckBoxIndeterminatePathData">M3.997 13H20a1 1 0 1 0 0-2H3.997a1 1 0 1 0 0 2Z</StreamGeometry>
1516
<StreamGeometry x:Key="CheckMarkPathData">M5.5 10.586 1.707 6.793A1 1 0 0 0 .293 8.207l4.5 4.5a1 1 0 0 0 1.414 0l11-11A1 1 0 0 0 15.793.293L5.5 10.586Z</StreamGeometry>
1617
<x:Double x:Key="CheckBoxMinHeight">32</x:Double>
1718
<!-- WinUI forces MinWidth=120, which breaks desktop form layouts (and v1 never had it).
1819
Deliberately 0 here; override this resource to restore the WinUI metric. -->
1920
<x:Double x:Key="CheckBoxMinWidth">0</x:Double>
21+
<x:Double x:Key="CheckBoxSize">20</x:Double>
22+
<x:Double x:Key="CheckBoxGlyphSize">12</x:Double>
2023

2124
<!-- WinUI reference: CheckBox_themeresources.xaml (DefaultCheckBoxStyle), tag winui3/release/1.5.2 -->
2225
<ControlTheme x:Key="{x:Type CheckBox}" TargetType="CheckBox">
@@ -50,12 +53,12 @@
5053
BorderThickness="{DynamicResource CheckBoxBorderThemeThickness}"
5154
CornerRadius="{TemplateBinding CornerRadius}"
5255
UseLayoutRounding="False"
53-
Height="20"
54-
Width="20" />
56+
Height="{DynamicResource CheckBoxSize}"
57+
Width="{DynamicResource CheckBoxSize}" />
5558

5659
<Viewbox UseLayoutRounding="False">
5760
<Panel>
58-
<Panel Height="16" Width="16" />
61+
<Panel Height="{DynamicResource CheckBoxGlyphSize}" Width="{DynamicResource CheckBoxGlyphSize}" />
5962
<Path x:Name="CheckGlyph"
6063
Opacity="0"
6164
Fill="{DynamicResource CheckBoxCheckGlyphForegroundUnchecked}"
@@ -239,7 +242,7 @@
239242

240243
<Style Selector="^ /template/ Path#CheckGlyph">
241244
<Setter Property="Fill" Value="{DynamicResource CheckBoxCheckGlyphForegroundIndeterminate}" />
242-
<Setter Property="Data" Value="M1536 1536v-1024h-1024v1024h1024z" />
245+
<Setter Property="Data" Value="{DynamicResource CheckBoxIndeterminatePathData}" />
243246
<Setter Property="Width" Value="7" />
244247
<Setter Property="Opacity" Value="1" />
245248
</Style>

0 commit comments

Comments
 (0)