Add automation properties

This commit is contained in:
Eric Tian 2021-03-02 18:34:37 -08:00
commit a91ca49faa
4 changed files with 36 additions and 23 deletions

View file

@ -4258,7 +4258,7 @@
<value>Hide equation</value> <value>Hide equation</value>
<comment>This is the tooltip/automation name shown when visibility is set to visible in the graphing calculator.</comment> <comment>This is the tooltip/automation name shown when visibility is set to visible in the graphing calculator.</comment>
</data> </data>
<data name="showEquationButtonAutomationName" xml:space="preserve"> <data name="showEquationButtonAutomationName" xml:space="preserve">
<value>Show equation %1</value> <value>Show equation %1</value>
<comment>{Locked="%1"}, This is the tooltip/automation name shown when visibility is set to hidden in the graphing calculator. %1 is the equation number.</comment> <comment>{Locked="%1"}, This is the tooltip/automation name shown when visibility is set to hidden in the graphing calculator. %1 is the equation number.</comment>
</data> </data>
@ -4738,4 +4738,7 @@
<value>To learn how you can contribute to Windows Calculator, visit the project on%HL%GitHub%HL%.</value> <value>To learn how you can contribute to Windows Calculator, visit the project on%HL%GitHub%HL%.</value>
<comment>{Locked="%HL%GitHub%HL%"}. GitHub link, displayed on the settings page.</comment> <comment>{Locked="%HL%GitHub%HL%"}. GitHub link, displayed on the settings page.</comment>
</data> </data>
<data name="BackButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Back</value>
</data>
</root> </root>

View file

@ -97,13 +97,15 @@
AutomationProperties.HeadingLevel="Level2" AutomationProperties.HeadingLevel="Level2"
TextTrimming="Clip"/> TextTrimming="Clip"/>
<TextBlock Margin="0,0,0,4" <RichTextBlock Margin="0,0,0,4"
Style="{StaticResource BodyTextBlockStyle}" Style="{StaticResource BodyRichTextBlockStyle}"
IsTextSelectionEnabled="True"> IsTextSelectionEnabled="True">
<Run x:Name="SettingsVersion"/> <Paragraph>
<LineBreak/> <Run x:Name="SettingsVersion"/>
<Run x:Name="SettingsCopyright"/> <LineBreak/>
</TextBlock> <Run x:Name="SettingsCopyright"/>
</Paragraph>
</RichTextBlock>
<HyperlinkButton Margin="0,-2" <HyperlinkButton Margin="0,-2"
HorizontalAlignment="Left" HorizontalAlignment="Left"
@ -134,20 +136,22 @@
Style="{StaticResource ButtonRevealStyle}" Style="{StaticResource ButtonRevealStyle}"
Click="SettingsFeedbackButtonClick"/> Click="SettingsFeedbackButtonClick"/>
<TextBlock x:Name="SettingsContribute" <RichTextBlock x:Name="SettingsContribute"
Margin="0,12,12,6" Margin="0,12,12,6"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Style="{ThemeResource BodyTextBlockStyle}" Style="{ThemeResource BodyRichTextBlockStyle}"
Foreground="{ThemeResource SystemControlPageTextBaseHighBrush}" Foreground="{ThemeResource SystemControlPageTextBaseHighBrush}"
TextWrapping="Wrap"> TextWrapping="Wrap">
<Run x:Name="ContributeRunBeforeLink"/> <Paragraph>
<Hyperlink NavigateUri="https://go.microsoft.com/fwlink/?linkid=2099939" <Run x:Name="ContributeRunBeforeLink"/>
TextDecorations="None" <Hyperlink NavigateUri="https://go.microsoft.com/fwlink/?linkid=2099939"
ToolTipService.ToolTip="https://go.microsoft.com/fwlink/?linkid=2099939"> TextDecorations="None"
<Run x:Name="ContributeRunLink"/> ToolTipService.ToolTip="https://go.microsoft.com/fwlink/?linkid=2099939">
</Hyperlink> <Run x:Name="ContributeRunLink"/>
<Run x:Name="ContributeRunAfterLink"/> </Hyperlink>
</TextBlock> <Run x:Name="ContributeRunAfterLink"/>
</Paragraph>
</RichTextBlock>
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
</Grid> </Grid>

View file

@ -38,7 +38,7 @@ SettingsPage::SettingsPage()
this->SetVersionString(); this->SetVersionString();
this->SetCopyrightString(); this->SetCopyrightString();
this->InitializeContributeTextBlock(); this->InitializeContributeTextBlock();
SettingsLightTheme->Focus(::FocusState::Keyboard); SetDefaultFocus();
if (themevalue != nullptr) if (themevalue != nullptr)
{ {
@ -90,6 +90,11 @@ void SettingsPage::OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventA
} }
} }
void SettingsPage::SetDefaultFocus()
{
SettingsLightTheme->Focus(::FocusState::Programmatic);
}
void SettingsPage::InitializeContributeTextBlock() void SettingsPage::InitializeContributeTextBlock()
{ {
auto resourceLoader = AppResourceProvider::GetInstance(); auto resourceLoader = AppResourceProvider::GetInstance();

View file

@ -20,6 +20,7 @@ namespace CalculatorApp
private: private:
Platform::String ^ m_currentTheme; Platform::String ^ m_currentTheme;
void SetDefaultFocus();
void InitializeContributeTextBlock(); void InitializeContributeTextBlock();
void BackButtonClick(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e); void BackButtonClick(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
void ColorSettingsButtonClicked(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::RoutedEventArgs ^ e); void ColorSettingsButtonClicked(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::RoutedEventArgs ^ e);