From a2f224225e33d4401992423ced546f74544f51f5 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Mon, 2 Mar 2026 18:20:09 +0800 Subject: [PATCH] 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. --- Flow.Launcher/MainWindow.xaml | 1 + Flow.Launcher/MainWindow.xaml.cs | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index 747975b2a..9d6b51dcc 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -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" diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index 06b2dda9e..60517db97 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -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)