Skip to content

Conversation

@taooceros
Copy link
Member

@taooceros taooceros commented Jun 15, 2021

The storyboard is only able to be controlled if using Begin(object, controllable) for beginning.

Maybe this can actually drop cpu usage to 0.

Related to #128

@taooceros taooceros changed the title fix storyboard animation control fix storyboard animation control error Jun 15, 2021
@taooceros
Copy link
Member Author

In Sysinternal Process explorer, after hiding, the cpu will be lower than 0.01. I believe that's acceptable.
image

@jjw24
Copy link
Member

jjw24 commented Jun 15, 2021

Also have you tested it still stops when hidden and starts again when visible as per the original behaviour?

@taooceros
Copy link
Member Author

Also have you tested it still stops when hidden and starts again when visible as per the original behaviour?

Yes, I have tested hide and start a few times, and also triggering progress bar animation by requesting suggestion source. However, let me test more about whether the animation is working properly.

@taooceros
Copy link
Member Author

A small issue is that the progress bar animation will start at the position it stop last time. Should we reset the position?

@jjw24
Copy link
Member

jjw24 commented Jun 15, 2021

This is the query window re-appearing after hiding and query is still running? Then yeah I think resetting it is fine.

2. Use begin/stop instead of resume/pause to reset position
3. Add a small delay when stopping the animation after hiding to make the animation more fluently
@taooceros taooceros requested a review from jjw24 June 15, 2021 13:38
@jjw24 jjw24 enabled auto-merge June 16, 2021 10:56
}, System.Windows.Threading.DispatcherPriority.Render);
if (_viewModel.ProgressBarVisibility == Visibility.Hidden && !isProgressBarStoryboardPaused)
{
await Task.Delay(50);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the delay?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make it stop after hiding, or else user may feel a bit stunt.

@jjw24 jjw24 added the bug Something isn't working label Jun 16, 2021
@taooceros
Copy link
Member Author

hmmm hold on, after the last commit it seems that flow will still consume some cpu cycle when hiding. Let me take another check.

@taooceros
Copy link
Member Author

ok fixed

@jjw24 jjw24 merged commit 477d988 into Flow-Launcher:dev Jun 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants