Fix unfocused appearance UI in settings (#19263)

The unfocused appearance section in the settings UI looks a little off.
Specifically, the header was too large (larger than the breadcrumbs!)
and the button was weirdly aligned.

This PR reduces the size of the header and creates a style in
CommonResources that manages it. This is the only place it's used, for
now. A vertical alignment was added to the "create appearance" and
"delete appearance" buttons to make them look better. The top margin of
the "Text" header was also removed so that there isn't an awkward gap in
the unfocused appearance section (the 32 that was there was moved to the
bottom of the control preview so that that area remains unaffected.)

Follow-up from #19001
This commit is contained in:
Carlos Zamora
2025-08-25 10:32:49 -07:00
committed by GitHub
parent 7578209be5
commit d61ad2d9cd
3 changed files with 12 additions and 1 deletions

View File

@@ -68,6 +68,7 @@
<StackPanel Style="{StaticResource PivotStackStyle}">
<!-- Grouping: Text -->
<TextBlock x:Uid="Profile_TextHeader"
Margin="0,0,0,4"
Style="{StaticResource TextBlockSubHeaderStyle}" />
<!-- Color Scheme -->
<!-- This currently only display the Dark color scheme, even if the user has a pair of schemes set. -->

View File

@@ -160,6 +160,13 @@
<Setter Property="Margin" Value="0,32,0,4" />
</Style>
<Style x:Key="TextBlockSubtitleStyle"
BasedOn="{StaticResource SubtitleTextBlockStyle}"
TargetType="TextBlock">
<Setter Property="MaxWidth" Value="{StaticResource StandardControlMaxWidth}" />
<Setter Property="Margin" Value="0,32,0,4" />
</Style>
<!-- Used for disclaimers -->
<Style x:Key="DisclaimerStyle"
TargetType="TextBlock">

View File

@@ -64,6 +64,7 @@
Style="{StaticResource SettingsStackStyle}">
<!-- Control Preview -->
<Border MaxWidth="{StaticResource StandardControlMaxWidth}"
Margin="0,0,0,32"
CornerRadius="{StaticResource ControlCornerRadius}">
<Border x:Name="ControlPreview"
Width="400"
@@ -205,9 +206,10 @@
<StackPanel Orientation="Horizontal"
Visibility="{x:Bind Profile.EditableUnfocusedAppearance, Mode=OneWay}">
<TextBlock x:Uid="Profile_UnfocusedAppearanceTextBlock"
Style="{StaticResource TitleTextBlockStyle}" />
Style="{StaticResource TextBlockSubtitleStyle}" />
<Button x:Uid="Profile_CreateUnfocusedAppearanceButton"
Margin="8,0,0,0"
VerticalAlignment="Bottom"
Click="CreateUnfocusedAppearance_Click"
Style="{StaticResource BaseButtonStyle}"
Visibility="{x:Bind mtu:Converters.InvertedBooleanToVisibility(Profile.HasUnfocusedAppearance), Mode=OneWay}">
@@ -224,6 +226,7 @@
</Button>
<Button x:Uid="Profile_DeleteUnfocusedAppearanceButton"
Margin="8,0,0,0"
VerticalAlignment="Bottom"
Click="DeleteUnfocusedAppearance_Click"
Style="{StaticResource DeleteButtonStyle}"
Visibility="{x:Bind Profile.HasUnfocusedAppearance, Mode=OneWay}">