Skip to content

Commit 2db3f82

Browse files
committed
change logic
1. Disable animation when progressbar is hidden or mainwindow is collapsed 2. resume only when both visibility and progressbar visibility is visible
1 parent 5d1790c commit 2db3f82

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System;
1+

2+
using System;
23
using System.ComponentModel;
34
using System.Windows;
45
using System.Windows.Input;
@@ -85,9 +86,14 @@ private void OnLoaded(object sender, RoutedEventArgs _)
8586
_viewModel.LastQuerySelected = true;
8687
}
8788

89+
if (_viewModel.ProgressBarVisibility == Visibility.Visible)
90+
{
91+
_progressBarStoryboard.Resume();
92+
}
8893
}
8994
else
9095
{
96+
_progressBarStoryboard.Pause();
9197
}
9298
}
9399
else if (e.PropertyName == nameof(MainViewModel.ProgressBarVisibility))
@@ -98,7 +104,7 @@ private void OnLoaded(object sender, RoutedEventArgs _)
98104
{
99105
_progressBarStoryboard.Pause();
100106
}
101-
else
107+
else if (Visibility == Visibility.Visible)
102108
{
103109
_progressBarStoryboard.Resume();
104110
}

0 commit comments

Comments
 (0)