tweak the aura
MODIFY
WalletWasabi.Fluent/Controls/SpectrumControl.cs
WalletWasabi.Fluent/Controls/SpectrumControl.cs
@@ -18,6 +18,9 @@ public class SpectrumControl : TemplatedControl
private const int NumBins = 250;
private const int NumAverages = 30;
+ public static readonly StyledProperty<bool> IsActiveProperty =
+ AvaloniaProperty.Register<SpectrumControl, bool>(nameof(IsActive));
+
public SpectrumControl()
{
_bins = new double[NumBins];
@@ -34,15 +37,51 @@ public class SpectrumControl : TemplatedControl
}
};
- DispatcherTimer.Run(() =>
+ _timer = new DispatcherTimer
+ {
+ Interval = TimeSpan.FromSeconds(0.2)
+ };
+
+ _timer.Tick += TimerOnTick;
+ }
+
+ private void TimerOnTick(object? sender, EventArgs e)
{
+ var isActive = IsActive;
+
for (int i = 0; i < NumBins; i++)
{
- _bins[i] = _random.NextDouble();
+ _bins[i] = isActive ? _random.NextDouble() : 0;
+ }
+
+ if (!isActive)
+ {
+ _timer.Stop();
+ }
}
- return true;
- }, TimeSpan.FromSeconds(0.2));
+ private void OnIsActiveChanged()
+ {
+ if (IsActive)
+ {
+ _timer.Start();
+ }
+ }
+
+ protected override void OnPropertyChanged<T>(AvaloniaPropertyChangedEventArgs<T> change)
+ {
+ base.OnPropertyChanged(change);
+
+ if (change.Property == IsActiveProperty)
+ {
+ OnIsActiveChanged();
+ }
+ }
+
+ public bool IsActive
+ {
+ get => GetValue(IsActiveProperty);
+ set => SetValue(IsActiveProperty, value);
}
protected override Size ArrangeOverride(Size finalSize)

MODIFY
WalletWasabi.Fluent/Views/MainView.axaml
WalletWasabi.Fluent/Views/MainView.axaml
<DockPanel>
<Panel Background="{DynamicResource RegionColor}" DockPanel.Dock="Bottom" VerticalAlignment="Bottom"
Height="64">
- <c:SpectrumControl Opacity="0.8" />
+ <c:SpectrumControl Opacity="0.6" IsActive="True" />
<c:CustomBlurBehind />
<statusBar:StatusBar DataContext="{Binding StatusBar}" />
<Border Padding="20 10" CornerRadius="4" BorderThickness="1" Background="#19FFFFFF" BorderBrush="#3CFFFFFF" Height="48" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="40 0">
<StackPanel Orientation="Horizontal" Spacing="20">
<TextBlock Text="Round in progress: 2m 15s remaining" VerticalAlignment="Center" />
<Separator Classes="vertical" />
+ <Button Classes="plain">
<PathIcon Data="{StaticResource pause_regular}" />
+ </Button>
+ <Button Classes="plain">
<PathIcon Data="{StaticResource stop_regular}" />
+ </Button>
</StackPanel>
</Border>
</Panel>

tweak the aura