Skip to content

Commit

Permalink
Update Settings Page (#2094)
Browse files Browse the repository at this point in the history
* Fix monochrome image of About expander in Settings page

* Update style

* Remove resource

* Remove unused style
  • Loading branch information
hanzhang54 authored Dec 5, 2023
1 parent c2c4795 commit 48b8dc1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
4 changes: 0 additions & 4 deletions src/Calculator/Resources/en-US/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -4750,8 +4750,4 @@
<value>Settings page</value>
<comment>Announcement used when Settings page is opened</comment>
</data>
<data name="AppThemeExpander.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>App theme setting</value>
<comment>Screen reader prompt for the App theme Setting radio buttons group</comment>
</data>
</root>
26 changes: 12 additions & 14 deletions src/Calculator/Views/Settings.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:automation="using:CalculatorApp.ViewModel.Common.Automation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:toolkit="using:CommunityToolkit.WinUI.Controls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
xmlns:toolkit="using:CommunityToolkit.WinUI.Controls"
xmlns:utils="using:CalculatorApp.Utils"
Loaded="OnLoaded"
Unloaded="OnUnloaded"
Expand All @@ -32,12 +32,6 @@
<Setter Property="TextWrapping" Value="Wrap"/>
</Style>

<Style x:Key="SettingsCategoryTitleTextBlockStyle"
BasedOn="{StaticResource BodyStrongTextBlockStyle}"
TargetType="TextBlock">
<Setter Property="Margin" Value="0,30,0,4"/>
</Style>

<automation:NarratorNotifier x:Name="NarratorNotifier"/>

<!-- Override default hyperlink button background color -->
Expand All @@ -51,6 +45,7 @@
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="{x:Bind TitleBarHeight, Mode=OneWay}"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>

Expand All @@ -76,8 +71,7 @@
Text="{utils:ResourceString Name=SettingsHeader/Text}"/>
</Grid>

<ScrollViewer Grid.Row="1"
Margin="0,30,0,0"
<ScrollViewer Grid.Row="2"
Padding="24,0,24,16"
Style="{StaticResource SettingsContentScrollViewStyle}">

Expand All @@ -86,12 +80,13 @@
<EntranceThemeTransition FromVerticalOffset="50" IsStaggeringEnabled="True"/>
<RepositionThemeTransition IsStaggeringEnabled="False"/>
</StackPanel.ChildrenTransitions>
<TextBlock Style="{StaticResource SettingsCategoryTitleTextBlockStyle}"
<TextBlock Margin="0,12,0,4"
Style="{StaticResource BodyStrongTextBlockStyle}"
AutomationProperties.HeadingLevel="Level1"
Text="{utils:ResourceString Name=SettingsAppearance/Text}"/>
<toolkit:SettingsExpander x:Name="AppThemeExpander"
Description="{utils:ResourceString Name=AppThemeExpander/Description}"
Header="{utils:ResourceString Name=AppThemeExpander/Header}">
Description="{utils:ResourceString Name=AppThemeExpander/Description}"
Header="{utils:ResourceString Name=AppThemeExpander/Header}">
<toolkit:SettingsExpander.HeaderIcon>
<FontIcon Glyph="&#xE790;"/>
</toolkit:SettingsExpander.HeaderIcon>
Expand All @@ -115,12 +110,15 @@
</toolkit:SettingsExpander>

<TextBlock x:Name="AboutGroupTitle"
Style="{ThemeResource SettingsCategoryTitleTextBlockStyle}"
Margin="0,30,0,4"
Style="{StaticResource BodyStrongTextBlockStyle}"
AutomationProperties.HeadingLevel="Level1"
Text="{utils:ResourceString Name=AboutGroupTitle/Text}"/>
<toolkit:SettingsExpander x:Name="AboutExpander">
<toolkit:SettingsExpander.HeaderIcon>
<BitmapIcon AutomationProperties.AccessibilityView="Raw" UriSource="ms-appx:///Assets/CalculatorAppList.png"/>
<BitmapIcon AutomationProperties.AccessibilityView="Raw"
ShowAsMonochrome="False"
UriSource="ms-appx:///Assets/CalculatorAppList.png"/>
</toolkit:SettingsExpander.HeaderIcon>
<TextBlock x:Name="AboutBuildVersion"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
Expand Down

0 comments on commit 48b8dc1

Please sign in to comment.