Adjust Progressbar

This commit is contained in:
DB p 2022-12-17 18:37:24 +09:00
parent 2fda16cfd4
commit a299f36a41
2 changed files with 22 additions and 18 deletions

View file

@ -261,16 +261,6 @@
</StackPanel>
<Border>
<Grid>
<ui:ProgressRing
x:Name="ProgressBar"
Width="24"
Height="24"
Margin="0,0,68,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Panel.ZIndex="2"
IsActive="true"
Visibility="{Binding ProgressBarVisibility, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<Image
x:Name="PluginActivationIcon"
Width="32"
@ -294,6 +284,20 @@
</Canvas>
</Grid>
</Border>
<Line
x:Name="ProgressBar"
Width="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Grid}}, Path=ActualWidth}"
Height="2"
Margin="12,0,12,0"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
StrokeThickness="2"
Style="{DynamicResource PendingLineStyle}"
Visibility="{Binding ProgressBarVisibility, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
X1="-100"
X2="0"
Y1="0"
Y2="0" />
</Grid>
<Grid ClipToBounds="True">
@ -320,6 +324,7 @@
HorizontalAlignment="Stretch"
Style="{DynamicResource SeparatorStyle}" />
</ContentControl>
</Grid>
<Grid>
<Grid.ColumnDefinitions>

View file

@ -362,15 +362,14 @@ namespace Flow.Launcher
private void InitProgressbarAnimation()
{
//var da = new DoubleAnimation(ProgressBar.X2, ActualWidth + 150,
// new Duration(new TimeSpan(0, 0, 0, 0, 1600)));
//var da1 = new DoubleAnimation(ProgressBar.X1, ActualWidth + 50, new Duration(new TimeSpan(0, 0, 0, 0, 1600)));
//Storyboard.SetTargetProperty(da, new PropertyPath("(Line.X2)"));
//Storyboard.SetTargetProperty(da1, new PropertyPath("(Line.X1)"));
//_progressBarStoryboard.Children.Add(da);
//_progressBarStoryboard.Children.Add(da1);
_progressBarStoryboard.RepeatBehavior = RepeatBehavior.Forever;
var da = new DoubleAnimation(ProgressBar.X2, ActualWidth + 100, new Duration(new TimeSpan(0, 0, 0, 0, 1600)));
var da1 = new DoubleAnimation(ProgressBar.X1, ActualWidth + 0, new Duration(new TimeSpan(0, 0, 0, 0, 1600)));
Storyboard.SetTargetProperty(da, new PropertyPath("(Line.X2)"));
Storyboard.SetTargetProperty(da1, new PropertyPath("(Line.X1)"));
_progressBarStoryboard.Children.Add(da);
_progressBarStoryboard.Children.Add(da1);
_progressBarStoryboard.RepeatBehavior = RepeatBehavior.Forever;
_viewModel.ProgressBarVisibility = Visibility.Hidden;
isProgressBarStoryboardPaused = true;
}