@@ -21,17 +21,6 @@ public GridLength CaptionHeight
2121 set => SetAndRaise ( CaptionHeightProperty , ref _captionHeight , value ) ;
2222 }
2323
24- public static readonly DirectProperty < Launcher , bool > HasLeftCaptionButtonProperty =
25- AvaloniaProperty . RegisterDirect < Launcher , bool > (
26- nameof ( HasLeftCaptionButton ) ,
27- o => o . HasLeftCaptionButton ) ;
28-
29- public bool HasLeftCaptionButton
30- {
31- get => _hasLeftCaptionButton ;
32- set => SetAndRaise ( HasLeftCaptionButtonProperty , ref _hasLeftCaptionButton , value ) ;
33- }
34-
3524 public bool HasRightCaptionButton
3625 {
3726 get
@@ -46,18 +35,11 @@ public bool HasRightCaptionButton
4635 public Launcher ( )
4736 {
4837 if ( OperatingSystem . IsMacOS ( ) )
49- {
50- HasLeftCaptionButton = true ;
5138 CaptionHeight = new GridLength ( 34 ) ;
52- }
5339 else if ( UseSystemWindowFrame )
54- {
5540 CaptionHeight = new GridLength ( 30 ) ;
56- }
5741 else
58- {
5942 CaptionHeight = new GridLength ( 38 ) ;
60- }
6143
6244 InitializeComponent ( ) ;
6345 PositionChanged += OnPositionChanged ;
@@ -112,9 +94,7 @@ protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs chang
11294 var state = ( WindowState ) change . NewValue ! ;
11395 _lastWindowState = ( WindowState ) change . OldValue ! ;
11496
115- if ( OperatingSystem . IsMacOS ( ) )
116- HasLeftCaptionButton = state != WindowState . FullScreen ;
117- else if ( ! UseSystemWindowFrame )
97+ if ( ! OperatingSystem . IsMacOS ( ) && ! UseSystemWindowFrame )
11898 CaptionHeight = new GridLength ( state == WindowState . Maximized ? 30 : 38 ) ;
11999
120100 ViewModels . Preferences . Instance . Layout . LauncherWindowState = state ;
@@ -125,7 +105,7 @@ protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs chang
125105 vm . CommandPalette = null ;
126106 }
127107
128- if ( HasLeftCaptionButton && OperatingSystem . IsMacOS ( ) )
108+ if ( OperatingSystem . IsMacOS ( ) && WindowState != WindowState . FullScreen )
129109 {
130110 if ( change . Property == WindowStateProperty ||
131111 change . Property == BoundsProperty ||
@@ -444,7 +424,6 @@ private void OnCloseCommandPalette(object sender, PointerPressedEventArgs e)
444424 }
445425
446426 private GridLength _captionHeight = new ( 32 ) ;
447- private bool _hasLeftCaptionButton = false ;
448427 private WindowState _lastWindowState = WindowState . Normal ;
449428 }
450429}
0 commit comments