Move progress bar animation init to Loaded event

InitProgressbarAnimation is now triggered by the progress bar's Loaded event instead of during main window initialization. This ensures the animation starts only after the progress bar is fully loaded, improving reliability and preventing potential UI timing issues.
This commit is contained in:
Jack251970 2026-03-02 18:20:09 +08:00
parent dda900041a
commit a2f224225e
2 changed files with 6 additions and 3 deletions

View file

@ -342,6 +342,7 @@
Margin="12 0 12 0"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
Loaded="ProgressBar_Loaded"
StrokeThickness="2"
Visibility="{Binding ProgressBarVisibility, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
X1="-100"

View file

@ -199,9 +199,6 @@ namespace Flow.Launcher
ThemeManager.Current.ApplicationTheme = ApplicationTheme.Dark;
}
// Initialize position
InitProgressbarAnimation();
// Force update position
UpdatePosition();
@ -354,6 +351,11 @@ namespace Flow.Launcher
}
}
private void ProgressBar_Loaded(object sender, RoutedEventArgs e)
{
InitProgressbarAnimation();
}
private async void OnClosing(object sender, CancelEventArgs e)
{
if (!CanClose)