Add link to GitHub repo on about flyout (#1449)
* Add link to GitHub repo on about flyout * Update AboutFlyout page GitHub link margin. * Update AboutPage GitHub link string.
This commit is contained in:
parent
61d06b2d2f
commit
c4793785c3
@ -14,6 +14,7 @@
|
|||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
@ -72,5 +73,21 @@
|
|||||||
Click="FeedbackButton_Click"/>
|
Click="FeedbackButton_Click"/>
|
||||||
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
<RichTextBlock x:Name="AboutFlyoutContribute"
|
||||||
|
Grid.Row="2"
|
||||||
|
Grid.ColumnSpan="2"
|
||||||
|
Margin="12,18,12,6"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
Foreground="{ThemeResource SystemControlPageTextBaseHighBrush}"
|
||||||
|
FontSize="{ThemeResource BodyFontSize}"
|
||||||
|
TextWrapping="Wrap">
|
||||||
|
<Paragraph>
|
||||||
|
<Run x:Name="ContributeRunBeforeLink"/><Hyperlink NavigateUri="https://go.microsoft.com/fwlink/?linkid=2099939"
|
||||||
|
TextDecorations="None"
|
||||||
|
ToolTipService.ToolTip="https://go.microsoft.com/fwlink/?linkid=2099939">
|
||||||
|
<Run x:Name="ContributeRunLink"/>
|
||||||
|
</Hyperlink><Run x:Name="ContributeRunAfterLink"/>
|
||||||
|
</Paragraph>
|
||||||
|
</RichTextBlock>
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
@ -40,6 +40,8 @@ AboutFlyout::AboutFlyout()
|
|||||||
auto copyrightText =
|
auto copyrightText =
|
||||||
LocalizationStringUtil::GetLocalizedString(resourceLoader->GetResourceString("AboutControlCopyright"), StringReference(to_wstring(BUILD_YEAR).c_str()));
|
LocalizationStringUtil::GetLocalizedString(resourceLoader->GetResourceString("AboutControlCopyright"), StringReference(to_wstring(BUILD_YEAR).c_str()));
|
||||||
AboutControlCopyrightRun->Text = copyrightText;
|
AboutControlCopyrightRun->Text = copyrightText;
|
||||||
|
|
||||||
|
InitializeContributeTextBlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AboutFlyout::FeedbackButton_Click(_In_ Object ^ sender, _In_ RoutedEventArgs ^ e)
|
void AboutFlyout::FeedbackButton_Click(_In_ Object ^ sender, _In_ RoutedEventArgs ^ e)
|
||||||
@ -61,3 +63,30 @@ void AboutFlyout::SetDefaultFocus()
|
|||||||
{
|
{
|
||||||
AboutFlyoutEULA->Focus(::FocusState::Programmatic);
|
AboutFlyoutEULA->Focus(::FocusState::Programmatic);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AboutFlyout::InitializeContributeTextBlock()
|
||||||
|
{
|
||||||
|
auto resProvider = AppResourceProvider::GetInstance();
|
||||||
|
std::wstring contributeHyperlinkText = resProvider->GetResourceString(L"AboutFlyoutContribute")->Data();
|
||||||
|
|
||||||
|
// The resource string has the 'GitHub' hyperlink wrapped with '%HL%'.
|
||||||
|
// Break the string and assign pieces appropriately.
|
||||||
|
static const std::wstring delimiter{ L"%HL%" };
|
||||||
|
static const size_t delimiterLength{ delimiter.length() };
|
||||||
|
|
||||||
|
// Find the delimiters.
|
||||||
|
size_t firstSplitPosition = contributeHyperlinkText.find(delimiter, 0);
|
||||||
|
assert(firstSplitPosition != std::wstring::npos);
|
||||||
|
size_t secondSplitPosition = contributeHyperlinkText.find(delimiter, firstSplitPosition + 1);
|
||||||
|
assert(secondSplitPosition != std::wstring::npos);
|
||||||
|
size_t hyperlinkTextLength = secondSplitPosition - (firstSplitPosition + delimiterLength);
|
||||||
|
|
||||||
|
// Assign pieces.
|
||||||
|
auto contributeTextBeforeHyperlink = ref new String(contributeHyperlinkText.substr(0, firstSplitPosition).c_str());
|
||||||
|
auto contributeTextLink = ref new String(contributeHyperlinkText.substr(firstSplitPosition + delimiterLength, hyperlinkTextLength).c_str());
|
||||||
|
auto contributeTextAfterHyperlink = ref new String(contributeHyperlinkText.substr(secondSplitPosition + delimiterLength).c_str());
|
||||||
|
|
||||||
|
ContributeRunBeforeLink->Text = contributeTextBeforeHyperlink;
|
||||||
|
ContributeRunLink->Text = contributeTextLink;
|
||||||
|
ContributeRunAfterLink->Text = contributeTextAfterHyperlink;
|
||||||
|
}
|
||||||
|
@ -18,5 +18,6 @@ public
|
|||||||
private:
|
private:
|
||||||
void FeedbackButton_Click(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::RoutedEventArgs ^ e);
|
void FeedbackButton_Click(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::RoutedEventArgs ^ e);
|
||||||
void SetVersionString();
|
void SetVersionString();
|
||||||
|
void InitializeContributeTextBlock();
|
||||||
};
|
};
|
||||||
} /* namespace CalculatorApp */
|
} /* namespace CalculatorApp */
|
||||||
|
@ -2717,6 +2717,10 @@
|
|||||||
<value>© %1 Microsoft. All rights reserved.</value>
|
<value>© %1 Microsoft. All rights reserved.</value>
|
||||||
<comment>{Locked="%1"}. Copyright statement, displayed on the About panel. %1 = the current year (4 digits)</comment>
|
<comment>{Locked="%1"}. Copyright statement, displayed on the About panel. %1 = the current year (4 digits)</comment>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="AboutFlyoutContribute" xml:space="preserve">
|
||||||
|
<value>To learn how you can contribute to Windows Calculator, check out the project on %HL%GitHub%HL%.</value>
|
||||||
|
<comment>{Locked="%HL%GitHub%HL%"}. GitHub link, Displayed on the About panel</comment>
|
||||||
|
</data>
|
||||||
<data name="AboutButton.Content" xml:space="preserve">
|
<data name="AboutButton.Content" xml:space="preserve">
|
||||||
<value>About</value>
|
<value>About</value>
|
||||||
<comment>The text that shows in the dropdown navigation control to open About panel</comment>
|
<comment>The text that shows in the dropdown navigation control to open About panel</comment>
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
<Style x:Key="AboutFlyoutPresenterStyle" TargetType="FlyoutPresenter">
|
<Style x:Key="AboutFlyoutPresenterStyle" TargetType="FlyoutPresenter">
|
||||||
<Setter Property="IsTabStop" Value="False"/>
|
<Setter Property="IsTabStop" Value="False"/>
|
||||||
<Setter Property="AutomationProperties.AccessibilityView" Value="Raw"/>
|
<Setter Property="AutomationProperties.AccessibilityView" Value="Raw"/>
|
||||||
|
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
|
||||||
</Style>
|
</Style>
|
||||||
<Style x:Key="NavViewItemStyle" TargetType="muxc:NavigationViewItem">
|
<Style x:Key="NavViewItemStyle" TargetType="muxc:NavigationViewItem">
|
||||||
<Setter Property="KeyTipPlacementMode" Value="Right"/>
|
<Setter Property="KeyTipPlacementMode" Value="Right"/>
|
||||||
@ -174,18 +175,18 @@
|
|||||||
|
|
||||||
<muxc:NavigationView.PaneFooter>
|
<muxc:NavigationView.PaneFooter>
|
||||||
<muxc:NavigationViewItem x:Name="AboutButton"
|
<muxc:NavigationViewItem x:Name="AboutButton"
|
||||||
x:Uid="AboutButton"
|
x:Uid="AboutButton"
|
||||||
Style="{StaticResource NavViewItemStyle}"
|
Style="{StaticResource NavViewItemStyle}"
|
||||||
Tapped="OnAboutButtonClick">
|
Tapped="OnAboutButtonClick">
|
||||||
<muxc:NavigationViewItem.Icon>
|
<muxc:NavigationViewItem.Icon>
|
||||||
<FontIcon FontFamily="{StaticResource CalculatorFontFamily}" Glyph=""/>
|
<FontIcon FontFamily="{StaticResource CalculatorFontFamily}" Glyph=""/>
|
||||||
</muxc:NavigationViewItem.Icon>
|
</muxc:NavigationViewItem.Icon>
|
||||||
<FlyoutBase.AttachedFlyout>
|
<FlyoutBase.AttachedFlyout>
|
||||||
<Flyout x:Name="AboutPageFlyout"
|
<Flyout x:Name="AboutPageFlyout"
|
||||||
x:Uid="AboutPageFlyout"
|
x:Uid="AboutPageFlyout"
|
||||||
Closed="OnAboutFlyoutClosed"
|
Closed="OnAboutFlyoutClosed"
|
||||||
FlyoutPresenterStyle="{StaticResource AboutFlyoutPresenterStyle}"
|
FlyoutPresenterStyle="{StaticResource AboutFlyoutPresenterStyle}"
|
||||||
Opened="OnAboutFlyoutOpened">
|
Opened="OnAboutFlyoutOpened">
|
||||||
<local:AboutFlyout x:Name="AboutPage" x:Load="False"/>
|
<local:AboutFlyout x:Name="AboutPage" x:Load="False"/>
|
||||||
</Flyout>
|
</Flyout>
|
||||||
</FlyoutBase.AttachedFlyout>
|
</FlyoutBase.AttachedFlyout>
|
||||||
|
Loading…
Reference in New Issue
Block a user