Skip to content

Commit a299f36

Browse files
committed
Adjust Progressbar
1 parent 2fda16c commit a299f36

File tree

2 files changed

+22
-18
lines changed

2 files changed

+22
-18
lines changed

Flow.Launcher/MainWindow.xaml

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -261,16 +261,6 @@
261261
</StackPanel>
262262
<Border>
263263
<Grid>
264-
<ui:ProgressRing
265-
x:Name="ProgressBar"
266-
Width="24"
267-
Height="24"
268-
Margin="0,0,68,0"
269-
HorizontalAlignment="Right"
270-
VerticalAlignment="Center"
271-
Panel.ZIndex="2"
272-
IsActive="true"
273-
Visibility="{Binding ProgressBarVisibility, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
274264
<Image
275265
x:Name="PluginActivationIcon"
276266
Width="32"
@@ -294,6 +284,20 @@
294284
</Canvas>
295285
</Grid>
296286
</Border>
287+
<Line
288+
x:Name="ProgressBar"
289+
Width="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Grid}}, Path=ActualWidth}"
290+
Height="2"
291+
Margin="12,0,12,0"
292+
HorizontalAlignment="Center"
293+
VerticalAlignment="Bottom"
294+
StrokeThickness="2"
295+
Style="{DynamicResource PendingLineStyle}"
296+
Visibility="{Binding ProgressBarVisibility, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
297+
X1="-100"
298+
X2="0"
299+
Y1="0"
300+
Y2="0" />
297301
</Grid>
298302

299303
<Grid ClipToBounds="True">
@@ -320,6 +324,7 @@
320324
HorizontalAlignment="Stretch"
321325
Style="{DynamicResource SeparatorStyle}" />
322326
</ContentControl>
327+
323328
</Grid>
324329
<Grid>
325330
<Grid.ColumnDefinitions>

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -362,15 +362,14 @@ private async void PositionReset()
362362
private void InitProgressbarAnimation()
363363
{
364364

365-
//var da = new DoubleAnimation(ProgressBar.X2, ActualWidth + 150,
366-
// new Duration(new TimeSpan(0, 0, 0, 0, 1600)));
367-
//var da1 = new DoubleAnimation(ProgressBar.X1, ActualWidth + 50, new Duration(new TimeSpan(0, 0, 0, 0, 1600)));
368-
//Storyboard.SetTargetProperty(da, new PropertyPath("(Line.X2)"));
369-
//Storyboard.SetTargetProperty(da1, new PropertyPath("(Line.X1)"));
370-
//_progressBarStoryboard.Children.Add(da);
371-
//_progressBarStoryboard.Children.Add(da1);
372-
_progressBarStoryboard.RepeatBehavior = RepeatBehavior.Forever;
365+
var da = new DoubleAnimation(ProgressBar.X2, ActualWidth + 100, new Duration(new TimeSpan(0, 0, 0, 0, 1600)));
366+
var da1 = new DoubleAnimation(ProgressBar.X1, ActualWidth + 0, new Duration(new TimeSpan(0, 0, 0, 0, 1600)));
373367

368+
Storyboard.SetTargetProperty(da, new PropertyPath("(Line.X2)"));
369+
Storyboard.SetTargetProperty(da1, new PropertyPath("(Line.X1)"));
370+
_progressBarStoryboard.Children.Add(da);
371+
_progressBarStoryboard.Children.Add(da1);
372+
_progressBarStoryboard.RepeatBehavior = RepeatBehavior.Forever;
374373
_viewModel.ProgressBarVisibility = Visibility.Hidden;
375374
isProgressBarStoryboardPaused = true;
376375
}

0 commit comments

Comments
 (0)