Dan Walmsley пре 5 година
родитељ
комит
6e47b625cf

+ 6 - 4
samples/ControlCatalog/ViewModels/MainWindowViewModel.cs

@@ -68,22 +68,24 @@ namespace ControlCatalog.ViewModels
             this.WhenAnyValue(x => x.SystemChromeButtonsEnabled, x=>x.ManagedChromeButtonsEnabled, x => x.SystemTitleBarEnabled)
                 .Subscribe(x =>
                 {
-                    ChromeHints = ExtendClientAreaChromeHints.NoChrome | ExtendClientAreaChromeHints.OSXThickTitleBar;
+                    var hints = ExtendClientAreaChromeHints.NoChrome | ExtendClientAreaChromeHints.OSXThickTitleBar;
 
                     if(x.Item1)
                     {
-                        ChromeHints |= ExtendClientAreaChromeHints.SystemChromeButtons;
+                        hints |= ExtendClientAreaChromeHints.SystemChromeButtons;
                     }
 
                     if(x.Item2)
                     {
-                        ChromeHints |= ExtendClientAreaChromeHints.ManagedChromeButtons;
+                        hints |= ExtendClientAreaChromeHints.ManagedChromeButtons;
                     }
 
                     if(x.Item3)
                     {
-                        ChromeHints |= ExtendClientAreaChromeHints.SystemTitleBar;
+                        hints |= ExtendClientAreaChromeHints.SystemTitleBar;
                     }
+
+                    ChromeHints = hints;
                 });
 
             SystemTitleBarEnabled = true;

+ 3 - 0
src/Avalonia.Controls/Chrome/TitleBar.cs

@@ -2,6 +2,7 @@
 using System.Reactive.Disposables;
 using Avalonia.Controls.Primitives;
 using Avalonia.Input;
+using Avalonia.LogicalTree;
 using Avalonia.Media;
 
 namespace Avalonia.Controls.Chrome
@@ -63,6 +64,8 @@ namespace Avalonia.Controls.Chrome
                         PseudoClasses.Set(":fullscreen", x == WindowState.FullScreen);
                     })
                 };
+
+                _captionButtons?.Attach(_hostWindow);
             }
         }
 

+ 2 - 5
src/Avalonia.Themes.Fluent/TitleBar.xaml

@@ -30,15 +30,13 @@
     <Setter Property="IsHitTestVisible" Value="True" />
   </Style>
   
-  
-
   <Style Selector="TitleBar:fullscreen /template/ Panel#PART_MouseTracker">
     <Setter Property="Background" Value="Transparent" />
   </Style>
 
   <Style Selector="TitleBar:fullscreen:not(:pointerover) /template/ Panel#PART_Container">
     <Style.Animations>
-      <Animation Duration="0:0:.5" Easing="SineEaseInOut">
+      <Animation Duration="0:0:.5" Easing="SineEaseInOut" FillMode="Both">
         <KeyFrame Cue="0%">
           <Setter Property="TranslateTransform.Y" Value="0"/>
         </KeyFrame>
@@ -47,12 +45,11 @@
         </KeyFrame>
       </Animation>
     </Style.Animations>
-    <Setter Property="TranslateTransform.Y" Value="-30" />
   </Style>
 
   <Style Selector="TitleBar:fullscreen:pointerover /template/ Panel#PART_Container">
     <Style.Animations>
-      <Animation Duration="0:0:.5" Easing="SineEaseInOut">
+      <Animation Duration="0:0:.5" Easing="SineEaseInOut" FillMode="Both">
         <KeyFrame Cue="0%">          
           <Setter Property="TranslateTransform.Y" Value="-30"/>          
         </KeyFrame>