Refactor InitProgressbarAnimation & avoid style cast issue #4499
Open
DavidGBrett wants to merge 8 commits into
Open
Refactor InitProgressbarAnimation & avoid style cast issue #4499DavidGBrett wants to merge 8 commits into
DavidGBrett wants to merge 8 commits into
Conversation
…ler in InitProgressbarAnimation This avoids the creation of a new style - so the problematic brush stroke with its SystemAccentColour resource in PendingLineStyle is not cloned
…f hardcoding it in InitProgressbarAnimation
…tions Clearer and more consistent with how its done elsewhere in the file.
…nimations in InitProgressbarAnimation
Contributor
📝 WalkthroughWalkthroughRefactors progress-bar animation in MainWindow to use a stored Storyboard started/stopped on visibility changes and adds a dynamic ChangesProgress Bar Animation Control
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
There was a problem hiding this comment.
1 issue found across 2 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Calculated version that waits for true visibility Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Should close #4348
Bug Fix
Avoids the creation of a new style based on PendingLineStyle as there seems to be a WPF bug in handling cloning of styles containing SystemAccentColors - seemingly the trigger for #4348 and other related issues.
That new style was created to add a trigger to play an animation if the progress bar is visible, so instead I moved that to an event handler.
Refactor
Summary by cubic
Refactors the progress bar animation to start/stop based on true visibility and moves style usage to XAML to avoid the style/brush cloning cast issue. Fixes the progress bar styling problem (see #4348) and simplifies the animation logic.
Summary of changes
_progressBarStoryboardwith explicit targets; useProgressBar.ActualWidthand dynamic length; keep animationsFreeze()d; setPendingLineStylein XAML viaDynamicResource; useProgressBar.IsVisibleinstead ofVisibility.IsVisibleChangedhandler to begin/stop the storyboard only when the bar is truly visible.Stylecreation with visibilityTrigger,BeginStoryboard/StopStoryboard, and storyboard name registration.Release Note
The progress bar animates more reliably and displays correctly, fixing a visual glitch.
Written for commit 238162a. Summary will update on new commits.