-
Notifications
You must be signed in to change notification settings - Fork 708
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: Fix issue with color changing when updating value while error state #3201
Changes from 3 commits
1209284
b9fd0fe
9f9449b
a4cc438
7b8b13c
9c8e5f2
3c92a95
a10278e
410d297
909300a
5ab2d71
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,11 @@ | |
<RepositionThemeAnimation TargetName="DeterminateProgressBarIndicator" FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.IndicatorLengthDelta}" /> | ||
</Storyboard> | ||
</VisualTransition> | ||
<VisualTransition From="UpdatingError" To="Error"> | ||
<Storyboard> | ||
<RepositionThemeAnimation TargetName="DeterminateProgressBarIndicator" FromHorizontalOffset="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.IndicatorLengthDelta}" /> | ||
</Storyboard> | ||
</VisualTransition> | ||
<VisualTransition From="Paused" To="Determinate"> | ||
<Storyboard> | ||
<DoubleAnimation | ||
|
@@ -65,6 +70,22 @@ | |
<VisualState x:Name="Normal" /> | ||
<VisualState x:Name="Determinate" /> | ||
<VisualState x:Name="Updating" /> | ||
<VisualState x:Name="UpdatingError"> | ||
<Storyboard> | ||
<Storyboard> | ||
<ColorAnimation | ||
Storyboard.TargetName="DeterminateProgressBarIndicator" | ||
Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" | ||
To="{Binding Source={ThemeResource SystemControlErrorTextForegroundBrush},Path=Color}" | ||
Duration="0:0:0.0"/> | ||
<ColorAnimation | ||
Storyboard.TargetName="ProgressBarRoot" | ||
Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" | ||
To="{StaticResource SystemControlErrorBackgroundColor}" | ||
Duration="0:0:0.0"/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is a setter more appropriate than a 0 duration story board? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Quite frankly, I wasn't able to get a setter to that property working. I've tried different variations of brackets and they always crashed. |
||
</Storyboard> | ||
</Storyboard> | ||
</VisualState> | ||
<VisualState x:Name="Indeterminate"> | ||
<Storyboard RepeatBehavior="Forever"> | ||
<DoubleAnimationUsingKeyFrames | ||
|
@@ -119,7 +140,7 @@ | |
Storyboard.TargetName="IndeterminateProgressBarIndicator2" | ||
Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"> | ||
<LinearColorKeyFrame Value="{ThemeResource SystemAccentColor}" KeyTime="0:0:2.75" /> | ||
<LinearColorKeyFrame Value="{ThemeResource SystemErrorTextColor}" KeyTime="0:0:3" /> | ||
<LinearColorKeyFrame Value="{Binding Source={ThemeResource SystemControlErrorTextForegroundBrush},Path=Color}" KeyTime="0:0:3" /> | ||
</ColorAnimationUsingKeyFrames> | ||
<ColorAnimationUsingKeyFrames | ||
Storyboard.TargetName="ProgressBarRoot" | ||
|
@@ -135,7 +156,7 @@ | |
<ColorAnimation | ||
Storyboard.TargetName="DeterminateProgressBarIndicator" | ||
Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" | ||
To="{ThemeResource SystemErrorTextColor}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is this change necessary? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to #1766 we should use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @YuliKl can you comment? This seems like it's going to create 2 extra allocations (at a minimum - one for the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry I missed this question earlier. A potential problem I foresee with using a Color resource is what happens with the control is running in High Contrast. SystemControlErrorTextForegroundBrush falls back to SystemColorWindowTextColor in HC (which can be modified by the user), but SystemErrorTextColor retains its static value of #FFF000. If we hardcode a color, I think we might get the appearance wrong in HC. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. looking at generic.xaml the high contrast version of the brush should be In reply to: 489609371 [](ancestors = 489609371) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So yes, there is a tangible difference between the brush and the color, and I think its worth keeping the binding. In reply to: 491100783 [](ancestors = 491100783,489609371) |
||
To="{Binding Source={ThemeResource SystemControlErrorTextForegroundBrush},Path=Color}" | ||
Duration="0:0:0.25"/> | ||
<ColorAnimation | ||
Storyboard.TargetName="ProgressBarRoot" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have two storyboards?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed now