Skip to content

Commit

Permalink
Merge pull request #392 from StegBrind/master
Browse files Browse the repository at this point in the history
Linux performance issue
  • Loading branch information
timschneeb authored Mar 9, 2023
2 parents 3cf21b3 + 64c708c commit fcb2328
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion GalaxyBudsClient/Interface/Elements/LoadingSpinner.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<RotateTransform Angle="0.0" />
</Image.RenderTransform>
<Image.Styles>
<Style Selector="Image">
<Style Selector="Image[IsVisible=True]">
<Style.Animations>
<Animation IterationCount="Infinite"
Duration="0:0:.5">
Expand Down
20 changes: 19 additions & 1 deletion GalaxyBudsClient/Interface/Elements/LoadingSpinner.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
using Avalonia.Controls;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;

namespace GalaxyBudsClient.Interface.Elements
{
public class LoadingSpinner : UserControl
{
private readonly Image _spinnerImage;

public LoadingSpinner()
{
AvaloniaXamlLoader.Load(this);

_spinnerImage = this.FindControl<Image>("Spinner");

PropertyChanged += (o, e) =>
{
if (e.Property.Name == nameof(IsVisible))
{
if (e.NewValue != null)
{
if ((bool)e.NewValue)
_spinnerImage.IsVisible = true;
else
_spinnerImage.IsVisible = false;
}
}
};
}
}
}

0 comments on commit fcb2328

Please sign in to comment.