Skip to content

Commit db27aeb

Browse files
Merge pull request #361 from CommunityToolkit/niels9001/settings-controls-improvements
[SettingsControls] A11y bugfix + visual update
2 parents 86c0047 + 3bc4503 commit db27aeb

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed

labs/SettingsControls/src/CommunityToolkit.Labs.WinUI.SettingsControls.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<Description>
1919
This package contains the SettingsCard and SettingsExpander controls.
2020
</Description>
21-
<Version>0.0.12</Version>
21+
<Version>0.0.13</Version>
2222
<LangVersion>10.0</LangVersion>
2323
</PropertyGroup>
2424

labs/SettingsControls/src/SettingsCard/SettingsCard.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ private void RegisterAutomation()
5353
{
5454
AutomationProperties.SetName(this, headerString);
5555
// We don't want to override an AutomationProperties.Name that is manually set, or if the Content basetype is of type ButtonBase (the ButtonBase.Content will be used then)
56-
if (Content is UIElement element && string.IsNullOrEmpty(AutomationProperties.GetName(element)) && element.GetType().BaseType != typeof(ButtonBase))
56+
if (Content is UIElement element && string.IsNullOrEmpty(AutomationProperties.GetName(element)) && element.GetType().BaseType != typeof(ButtonBase) && element.GetType() != typeof(TextBlock))
5757
{
5858
AutomationProperties.SetName(element, headerString);
5959
}

labs/SettingsControls/src/SettingsCard/SettingsCard.xaml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@
107107
<x:Double x:Key="SettingsCardLeftIndention">0</x:Double>
108108
<x:Double x:Key="SettingsCardContentMinWidth">120</x:Double>
109109
<Thickness x:Key="SettingsCardHeaderIconMargin">2,0,20,0</Thickness>
110-
<Thickness x:Key="SettingsCardVerticalHeaderContentSpacing">0,4,0,0</Thickness>
111-
<x:Double x:Key="SettingsCardWrapThreshold">460</x:Double>
110+
<Thickness x:Key="SettingsCardVerticalHeaderContentSpacing">0,8,0,0</Thickness>
111+
<x:Double x:Key="SettingsCardWrapThreshold">476</x:Double>
112112
<x:Double x:Key="SettingsCardWrapNoIconThreshold">286</x:Double>
113113

114114
<Style BasedOn="{StaticResource DefaultSettingsCardStyle}"
@@ -459,15 +459,11 @@
459459
<Setter Property="Template">
460460
<Setter.Value>
461461
<ControlTemplate TargetType="ToggleSwitch">
462-
<Grid VerticalAlignment="Center"
462+
<Grid VerticalAlignment="Stretch"
463463
Background="{TemplateBinding Background}"
464464
BorderBrush="{TemplateBinding BorderBrush}"
465465
BorderThickness="{TemplateBinding BorderThickness}"
466466
CornerRadius="{TemplateBinding CornerRadius}">
467-
<Grid.RowDefinitions>
468-
<RowDefinition Height="Auto" />
469-
<RowDefinition Height="*" />
470-
</Grid.RowDefinitions>
471467
<VisualStateManager.VisualStateGroups>
472468
<VisualStateGroup x:Name="CommonStates">
473469
<VisualState x:Name="Normal">
@@ -956,12 +952,7 @@
956952
Visibility="Collapsed" />
957953
<Grid Grid.Row="1"
958954
HorizontalAlignment="Right"
959-
VerticalAlignment="Top">
960-
<Grid.RowDefinitions>
961-
<RowDefinition Height="{ThemeResource ToggleSwitchPreContentMargin}" />
962-
<RowDefinition Height="Auto" />
963-
<RowDefinition Height="{ThemeResource ToggleSwitchPostContentMargin}" />
964-
</Grid.RowDefinitions>
955+
VerticalAlignment="Center">
965956
<Grid.ColumnDefinitions>
966957
<ColumnDefinition Width="Auto" />
967958
<ColumnDefinition Width="12"

0 commit comments

Comments
 (0)