Stop ProgressBar animation when Flow is hidden#295
Conversation
Co-Authored-By: imsh <9258159+imsh@users.noreply.github.com>
|
what happens when the query is still loading though? like if its a long running query, i click on some other window and come back a minute later, this change means the bar will stop if it's hidden despite the query is still running right? |
|
hmmm you are right. Let me use the dispatcher to disable and restart animation only when Progressbar visibility change instead of Mainwindow visibility. |
|
i dont think this is working as intended. Visibility doesnt seem to be wired up properly, because regardless whether the mainwindow is hidden or visible, the visibility is always visible. Same for progress bar visibility as well, it's always visible == true |
Flow.Launcher/MainWindow.xaml.cs
Outdated
| { | ||
| Dispatcher.Invoke(() => | ||
| { | ||
| if (ProgressBar.Visibility == Visibility.Hidden) |
There was a problem hiding this comment.
shouldnt this be MainViewModel.MainWindowVisibility? i thought we are resuming and pausing progress bar animation based on the visibility of mainwindow
There was a problem hiding this comment.
what happens when the query is still loading though? like if its a long running query, i click on some other window and come back a minute later, this change means the bar will stop if it's hidden despite the query is still running right?
That's the reason changing this to progressbar visibility
1. Disable animation when progressbar is hidden or mainwindow is collapsed 2. resume only when both visibility and progressbar visibility is visible
|
Done, please review. |
| } | ||
| else | ||
| { | ||
| _progressBarStoryboard.Pause(); |
There was a problem hiding this comment.
This is going to be called everytime the mainwindow is hidden, how come a check is not added here?
|
Not sure whether this can fix #128. Let's do more testing before close that via this pr. |
|
Although not from this change, this code does not set the progress bar when the main window is hidden. To repro, when main window is visible click anywhere else on the screen, the main window will be hidden, but the Visibility property is still visible rather than hidden. Wonder if this is an easy fix we can do? Flow.Launcher/Flow.Launcher/MainWindow.xaml.cs Lines 74 to 77 in d0af7a1 |
We can use MainViewModel.MainWindowVisibility instead. |
oh ok gotcha |
|
👍 👍 |
#128
Wox-launcher/Wox#3246
Co-Authored-By: imsh 9258159+imsh@users.noreply.github.com