|
@@ -12,6 +12,7 @@ public partial class MainTitleBar : UserControl
|
|
|
{
|
|
|
|
|
|
private MiniAnimationPlayer miniPlayer;
|
|
|
+ private Panel logoPanel;
|
|
|
public MainTitleBar()
|
|
|
{
|
|
|
InitializeComponent();
|
|
@@ -26,6 +27,22 @@ public partial class MainTitleBar : UserControl
|
|
|
{
|
|
|
base.OnLoaded(e);
|
|
|
miniPlayer = this.FindControl<MiniAnimationPlayer>("MiniPlayer");
|
|
|
+ logoPanel = this.FindControl<Panel>("LogoPanel");
|
|
|
+
|
|
|
+ if (IOperatingSystem.Current.IsMacOs && VisualRoot is Window window && logoPanel != null)
|
|
|
+ {
|
|
|
+ window.PropertyChanged += OnPropertyChanged;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void OnPropertyChanged(object? sender, AvaloniaPropertyChangedEventArgs e)
|
|
|
+ {
|
|
|
+ if (e.Property.Name == nameof(Window.WindowState) && logoPanel != null)
|
|
|
+ {
|
|
|
+ logoPanel.Margin = e.NewValue is WindowState and WindowState.FullScreen
|
|
|
+ ? new Thickness(10, 0, 0, 0)
|
|
|
+ : new Thickness(75, 0, 0, 0);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
protected override void OnSizeChanged(SizeChangedEventArgs e)
|