Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ProgressBar, PersonPicture, and MTC Updates #5090

Merged
merged 6 commits into from
Jun 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions dev/CommonStyles/MediaTransportControls_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
<x:Double x:Key="MediaTransportControlsAppBarButtonWidth">40</x:Double>
<x:Double x:Key="MediaTransportControlsSliderHeight">32</x:Double>
<x:Double x:Key="MediaTransportControlsSliderWidth">190</x:Double>
<x:Double x:Key="MediaTransportControlsMinWidth">296</x:Double>
<x:Double x:Key="MediaTransportControlsMaxWidth">720</x:Double>
</ResourceDictionary>
<ResourceDictionary x:Key="HighContrast">
<Thickness x:Key="MediaTransportControlsTitleSafeBounds">48,0,48,27</Thickness>
Expand All @@ -39,6 +41,8 @@
<x:Double x:Key="MediaTransportControlsAppBarButtonWidth">40</x:Double>
<x:Double x:Key="MediaTransportControlsSliderHeight">32</x:Double>
<x:Double x:Key="MediaTransportControlsSliderWidth">190</x:Double>
<x:Double x:Key="MediaTransportControlsMinWidth">296</x:Double>
<x:Double x:Key="MediaTransportControlsMaxWidth">720</x:Double>
</ResourceDictionary>
<ResourceDictionary x:Key="Light">
<Thickness x:Key="MediaTransportControlsTitleSafeBounds">48,0,48,27</Thickness>
Expand All @@ -56,6 +60,8 @@
<x:Double x:Key="MediaTransportControlsAppBarButtonWidth">40</x:Double>
<x:Double x:Key="MediaTransportControlsSliderHeight">32</x:Double>
<x:Double x:Key="MediaTransportControlsSliderWidth">190</x:Double>
<x:Double x:Key="MediaTransportControlsMinWidth">296</x:Double>
<x:Double x:Key="MediaTransportControlsMaxWidth">720</x:Double>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>

Expand All @@ -66,6 +72,8 @@
<Setter Property="Background" Value="Transparent" />
<Setter Property="FlowDirection" Value="LeftToRight" />
<Setter Property="Margin" Value="{ThemeResource MediaTransportControlsMargin}" />
<Setter Property="MaxWidth" Value="{ThemeResource MediaTransportControlsMaxWidth}" />
<Setter Property="MinWidth" Value="{ThemeResource MediaTransportControlsMinWidth}" />
<Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" />
<Setter Property="IsTextScaleFactorEnabled" Value="False" />
<contract7Present:Setter Property="CornerRadius" Value="{ThemeResource OverlayCornerRadius}" />
Expand Down
1 change: 1 addition & 0 deletions dev/CommonStyles/TestUI/MediaTransportControlsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
AreTransportControlsEnabled="True">
<MediaPlayerElement.TransportControls>
<MediaTransportControls
MaxWidth="500"
IsCompact="{x:Bind IsCompactCheckBox.IsChecked.Value, Mode=OneWay}"
IsSeekBarVisible="{x:Bind IsSeekBarVisibleCheckBox.IsChecked.Value, Mode=OneWay}"
IsFastForwardButtonVisible="{x:Bind IsFastForwardButtonVisibleCheckBox.IsChecked.Value, Mode=OneWay}"
Expand Down
5 changes: 3 additions & 2 deletions dev/PersonPicture/PersonPicture.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,9 @@
<Grid
x:Name="BadgeGrid"
Visibility="Collapsed"
VerticalAlignment="Bottom"
HorizontalAlignment="Right">
VerticalAlignment="Top"
HorizontalAlignment="Right"
Margin="{ThemeResource PersonPictureBadgeGridMargin}">

<Ellipse
x:Name="BadgingBackgroundEllipse"
Expand Down
29 changes: 16 additions & 13 deletions dev/PersonPicture/PersonPicture_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,30 @@
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Default">
<StaticResource x:Key="PersonPictureForegroundThemeBrush" ResourceKey="TextFillColorPrimaryBrush" />
<SolidColorBrush x:Key="PersonPictureEllipseBadgeForegroundThemeBrush" Color="{StaticResource SystemBaseHighColor}"/>
<SolidColorBrush x:Key="PersonPictureEllipseBadgeFillThemeBrush" Color="{StaticResource SystemChromeDisabledHighColor}"/>
<SolidColorBrush x:Key="PersonPictureEllipseBadgeStrokeThemeBrush" Color="{StaticResource SystemListMediumColor}"/>
<StaticResource x:Key="PersonPictureEllipseBadgeForegroundThemeBrush" ResourceKey="TextOnAccentFillColorPrimaryBrush"/>
<StaticResource x:Key="PersonPictureEllipseBadgeFillThemeBrush" ResourceKey="AccentFillColorDefaultBrush"/>
<StaticResource x:Key="PersonPictureEllipseBadgeStrokeThemeBrush" ResourceKey="ControlFillColorTransparentBrush"/>
<StaticResource x:Key="PersonPictureEllipseFillThemeBrush" ResourceKey="ControlAltFillColorQuarternary" />
<StaticResource x:Key="PersonPictureEllipseFillStrokeBrush" ResourceKey="CardStrokeColorDefaultBrush" />
<x:Double x:Key="PersonPictureEllipseBadgeStrokeOpacity">0.8</x:Double>
<x:Double x:Key="PersonPictureEllipseBadgeImageSourceStrokeOpacity">1.0</x:Double>
<x:Double x:Key="PersonPictureEllipseBadgeStrokeOpacity">1</x:Double>
<x:Double x:Key="PersonPictureEllipseBadgeImageSourceStrokeOpacity">1</x:Double>
<x:Double x:Key="PersonPictureEllipseStrokeThickness">1</x:Double>
<x:Double x:Key="PersonPictureEllipseBadgeStrokeThickness">2</x:Double>
<Thickness x:Key="PersonPictureBadgeGridMargin">0,-4,-4,0</Thickness>
</ResourceDictionary>

<ResourceDictionary x:Key="Light">
<StaticResource x:Key="PersonPictureForegroundThemeBrush" ResourceKey="TextFillColorPrimaryBrush" />
<SolidColorBrush x:Key="PersonPictureEllipseBadgeForegroundThemeBrush" Color="{StaticResource SystemBaseHighColor}"/>
<SolidColorBrush x:Key="PersonPictureEllipseBadgeFillThemeBrush" Color="{StaticResource SystemChromeDisabledHighColor}"/>
<SolidColorBrush x:Key="PersonPictureEllipseBadgeStrokeThemeBrush" Color="{StaticResource SystemListMediumColor}"/>
<StaticResource x:Key="PersonPictureEllipseBadgeForegroundThemeBrush" ResourceKey="TextOnAccentFillColorPrimaryBrush"/>
<StaticResource x:Key="PersonPictureEllipseBadgeFillThemeBrush" ResourceKey="AccentFillColorDefaultBrush"/>
<StaticResource x:Key="PersonPictureEllipseBadgeStrokeThemeBrush" ResourceKey="ControlFillColorTransparentBrush"/>
<StaticResource x:Key="PersonPictureEllipseFillThemeBrush" ResourceKey="ControlAltFillColorQuarternary" />
<StaticResource x:Key="PersonPictureEllipseFillStrokeBrush" ResourceKey="CardStrokeColorDefaultBrush" />
<x:Double x:Key="PersonPictureEllipseBadgeStrokeOpacity">0.8</x:Double>
<x:Double x:Key="PersonPictureEllipseBadgeImageSourceStrokeOpacity">1.0</x:Double>
<x:Double x:Key="PersonPictureEllipseBadgeStrokeOpacity">1</x:Double>
<x:Double x:Key="PersonPictureEllipseBadgeImageSourceStrokeOpacity">1</x:Double>
<x:Double x:Key="PersonPictureEllipseStrokeThickness">1</x:Double>
<x:Double x:Key="PersonPictureEllipseBadgeStrokeThickness">2</x:Double>
<Thickness x:Key="PersonPictureBadgeGridMargin">0,-4,-4,0</Thickness>
</ResourceDictionary>

<ResourceDictionary x:Key="HighContrast">
Expand All @@ -38,11 +40,12 @@
<SolidColorBrush x:Key="PersonPictureEllipseBadgeStrokeThemeBrush" Color="{ThemeResource SystemColorButtonTextColor}"/>
<StaticResource x:Key="PersonPictureEllipseFillThemeBrush" ResourceKey="SystemColorHighlightTextColorBrush" />
<StaticResource x:Key="PersonPictureEllipseFillStrokeBrush" ResourceKey="CardStrokeColorDefaultBrush" />
<x:Double x:Key="PersonPictureEllipseBadgeStrokeOpacity">1.0</x:Double>
<x:Double x:Key="PersonPictureEllipseBadgeImageSourceStrokeOpacity">1.0</x:Double>
<x:Double x:Key="PersonPictureEllipseBadgeStrokeOpacity">1</x:Double>
<x:Double x:Key="PersonPictureEllipseBadgeImageSourceStrokeOpacity">1</x:Double>
<x:Double x:Key="PersonPictureEllipseStrokeThickness">1</x:Double>
<x:Double x:Key="PersonPictureEllipseBadgeStrokeThickness">2</x:Double>
<Thickness x:Key="PersonPictureBadgeGridMargin">0,-4,-4,0</Thickness>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>

</ResourceDictionary>
</ResourceDictionary>
14 changes: 12 additions & 2 deletions dev/ProgressBar/ProgressBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,13 @@ void ProgressBar::OnIsIndeterminatePropertyChanged(const winrt::DependencyProper

void ProgressBar::OnShowPausedPropertyChanged(const winrt::DependencyPropertyChangedEventArgs& args)
{
SetProgressBarIndicatorWidth();
UpdateStates();
}

void ProgressBar::OnShowErrorPropertyChanged(const winrt::DependencyPropertyChangedEventArgs& args)
{
SetProgressBarIndicatorWidth();
UpdateStates();
}

Expand Down Expand Up @@ -148,7 +150,15 @@ void ProgressBar::SetProgressBarIndicatorWidth()

if (auto&& indeterminateProgressBarIndicator2 = m_indeterminateProgressBarIndicator2.get())
{
indeterminateProgressBarIndicator2.Width(progressBarWidth * 0.6); // 60% of ProgressBar Width
if (ShowPaused() || ShowError()) // If IndeterminatePaused or IndeterminateError
{
indeterminateProgressBarIndicator2.Width(progressBarWidth); // 100% of ProgressBar Width
}
else
{
indeterminateProgressBarIndicator2.Width(progressBarWidth * 0.6); // 60% of ProgressBar Width
}

}
}
else if (std::abs(maximum - minimum) > DBL_EPSILON)
Expand Down Expand Up @@ -194,7 +204,7 @@ void ProgressBar::UpdateWidthBasedTemplateSettings()
templateSettings->Container2AnimationStartPosition(indeterminateProgressBarIndicatorWidth2 * -1.5); // Position at -150%
templateSettings->Container2AnimationEndPosition(indeterminateProgressBarIndicatorWidth2 * 1.66); // Position at 166%

templateSettings->ContainerAnimationMidPosition(width * 0.2);
templateSettings->ContainerAnimationMidPosition(0);

const auto rectangle = [width, height, padding = Padding()]()
{
Expand Down
5 changes: 2 additions & 3 deletions dev/ProgressBar/ProgressBar.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@
<VisualState x:Name="UpdatingError">
<VisualState.Setters>
<Setter Target="DeterminateProgressBarIndicator.Fill" Value="{ThemeResource ProgressBarErrorForegroundColor}" />
<Setter Target="ProgressBarTrack.Fill" Value="{TemplateBinding Background}" />
</VisualState.Setters>
</VisualState>

Expand Down Expand Up @@ -167,7 +166,7 @@
Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)">
<SplineDoubleKeyFrame KeyTime="0:0:0.167" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.Container2AnimationEndPosition}" KeySpline="1.0, 1.0, 0.0, 1.0" />
<SplineDoubleKeyFrame KeyTime="0:0:0.167" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.Container2AnimationStartPosition}" KeySpline="1.0, 1.0, 0.0, 1.0" />
<SplineDoubleKeyFrame KeyTime="0:0:0.5" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ContainerAnimationMidPosition}" KeySpline="0.0, 0.0, 0.0, 1.0" />
<SplineDoubleKeyFrame KeyTime="0:0:0.75" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ContainerAnimationMidPosition}" KeySpline="0.0, 0.0, 0.0, 1.0" />
</DoubleAnimationUsingKeyFrames>
<ColorAnimation
Storyboard.TargetName="IndeterminateProgressBarIndicator2"
Expand Down Expand Up @@ -197,7 +196,7 @@
Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)">
<SplineDoubleKeyFrame KeyTime="0:0:0.167" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.Container2AnimationEndPosition}" KeySpline="1.0, 1.0, 0.0, 1.0" />
<SplineDoubleKeyFrame KeyTime="0:0:0.167" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.Container2AnimationStartPosition}" KeySpline="1.0, 1.0, 0.0, 1.0" />
<SplineDoubleKeyFrame KeyTime="0:0:0.5" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ContainerAnimationMidPosition}" KeySpline="0.0, 0.0, 0.0, 1.0" />
<SplineDoubleKeyFrame KeyTime="0:0:0.75" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ContainerAnimationMidPosition}" KeySpline="0.0, 0.0, 0.0, 1.0" />
</DoubleAnimationUsingKeyFrames>
<ColorAnimation
Storyboard.TargetName="IndeterminateProgressBarIndicator2"
Expand Down
110 changes: 110 additions & 0 deletions test/MUXControlsTestApp/verification/PersonPicture-4.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
[Microsoft.UI.Xaml.Controls.PersonPicture]
Padding=0,0,0,0
Foreground=#E4000000
BorderThickness=0,0,0,0
BorderBrush=[NULL]
Background=[NULL]
Width=100
Margin=0,0,0,0
Height=100
FocusVisualSecondaryThickness=1,1,1,1
FocusVisualSecondaryBrush=#B3FFFFFF
FocusVisualPrimaryThickness=2,2,2,2
FocusVisualPrimaryBrush=#E4000000
Visibility=Visible
RenderSize=100,100
[Windows.UI.Xaml.Controls.Grid]
Padding=0,0,0,0
CornerRadius=0,0,0,0
BorderThickness=0,0,0,0
BorderBrush=[NULL]
Background=[NULL]
Name=RootGrid
Margin=0,0,0,0
FocusVisualSecondaryThickness=1,1,1,1
FocusVisualSecondaryBrush=#B3FFFFFF
FocusVisualPrimaryThickness=2,2,2,2
FocusVisualPrimaryBrush=#E4000000
Visibility=Visible
RenderSize=100,100
[Windows.UI.Xaml.Shapes.Ellipse]
StrokeThickness=1
Width=100
Margin=0,0,0,0
Height=100
FocusVisualSecondaryThickness=1,1,1,1
FocusVisualSecondaryBrush=#B3FFFFFF
FocusVisualPrimaryThickness=2,2,2,2
FocusVisualPrimaryBrush=#E4000000
Visibility=Visible
RenderSize=100,100
[Windows.UI.Xaml.Controls.TextBlock]
Padding=0,0,0,0
Foreground=#E4000000
Name=InitialsTextBlock
Margin=0,0,0,0
FocusVisualSecondaryThickness=1,1,1,1
FocusVisualSecondaryBrush=#B3FFFFFF
FocusVisualPrimaryThickness=2,2,2,2
FocusVisualPrimaryBrush=#E4000000
Visibility=Visible
RenderSize=46,30
[Windows.UI.Xaml.Controls.Grid]
Padding=0,0,0,0
CornerRadius=0,0,0,0
BorderThickness=0,0,0,0
BorderBrush=[NULL]
Background=[NULL]
Name=BadgeGrid
Margin=0,-4,-4,0
FocusVisualSecondaryThickness=1,1,1,1
FocusVisualSecondaryBrush=#B3FFFFFF
FocusVisualPrimaryThickness=2,2,2,2
FocusVisualPrimaryBrush=#E4000000
Visibility=Collapsed
RenderSize=0,0
[Windows.UI.Xaml.Shapes.Ellipse]
StrokeThickness=2
Width=50
Name=BadgingBackgroundEllipse
Margin=0,0,0,0
Height=50
FocusVisualSecondaryThickness=1,1,1,1
FocusVisualSecondaryBrush=#B3FFFFFF
FocusVisualPrimaryThickness=2,2,2,2
FocusVisualPrimaryBrush=#E4000000
Visibility=Visible
RenderSize=0,0
[Windows.UI.Xaml.Shapes.Ellipse]
StrokeThickness=1
Width=50
Name=BadgingEllipse
Margin=0,0,0,0
Height=50
FocusVisualSecondaryThickness=1,1,1,1
FocusVisualSecondaryBrush=#B3FFFFFF
FocusVisualPrimaryThickness=2,2,2,2
FocusVisualPrimaryBrush=#E4000000
Visibility=Visible
RenderSize=0,0
[Windows.UI.Xaml.Controls.TextBlock]
Padding=0,0,0,0
Foreground=#FFFFFFFF
Name=BadgeNumberTextBlock
Margin=0,0,0,0
FocusVisualSecondaryThickness=1,1,1,1
FocusVisualSecondaryBrush=#B3FFFFFF
FocusVisualPrimaryThickness=2,2,2,2
FocusVisualPrimaryBrush=#E4000000
Visibility=Visible
RenderSize=0,0
[Windows.UI.Xaml.Controls.FontIcon]
Foreground=#FFFFFFFF
Name=BadgeGlyphIcon
Margin=0,0,0,0
FocusVisualSecondaryThickness=1,1,1,1
FocusVisualSecondaryBrush=#B3FFFFFF
FocusVisualPrimaryThickness=2,2,2,2
FocusVisualPrimaryBrush=#E4000000
Visibility=Visible
RenderSize=0,0
Loading