|
@@ -1,14 +1,17 @@
|
|
|
using Avalonia;
|
|
|
using Avalonia.Controls;
|
|
|
using Avalonia.Input;
|
|
|
+using Avalonia.Interactivity;
|
|
|
using Avalonia.Markup.Xaml;
|
|
|
using PixiEditor.OperatingSystem;
|
|
|
using PixiEditor.ViewModels.Menu;
|
|
|
|
|
|
namespace PixiEditor.Views.Main;
|
|
|
|
|
|
-public partial class MainTitleBar : UserControl {
|
|
|
-
|
|
|
+public partial class MainTitleBar : UserControl
|
|
|
+{
|
|
|
+
|
|
|
+ private MiniAnimationPlayer miniPlayer;
|
|
|
public MainTitleBar()
|
|
|
{
|
|
|
InitializeComponent();
|
|
@@ -19,6 +22,21 @@ public partial class MainTitleBar : UserControl {
|
|
|
AvaloniaXamlLoader.Load(this);
|
|
|
}
|
|
|
|
|
|
+ protected override void OnLoaded(RoutedEventArgs e)
|
|
|
+ {
|
|
|
+ base.OnLoaded(e);
|
|
|
+ miniPlayer = this.FindControl<MiniAnimationPlayer>("MiniPlayer");
|
|
|
+ }
|
|
|
+
|
|
|
+ protected override void OnSizeChanged(SizeChangedEventArgs e)
|
|
|
+ {
|
|
|
+ base.OnSizeChanged(e);
|
|
|
+ if (miniPlayer != null)
|
|
|
+ {
|
|
|
+ miniPlayer.IsVisible = e.NewSize.Width > 1165;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
|
|
|
{
|
|
|
base.OnAttachedToVisualTree(e);
|