Browse Source

dont keep capture when minimising.

demo1
Dan Walmsley 6 years ago
parent
commit
50ec4da4cd
  1. 8
      src/Avalonia.Controls/Chrome/CaptionButtons.cs

8
src/Avalonia.Controls/Chrome/CaptionButtons.cs

@ -54,10 +54,10 @@ namespace Avalonia.Controls.Chrome
var minimiseButton = e.NameScope.Find<Panel>("PART_MinimiseButton");
var fullScreenButton = e.NameScope.Find<Panel>("PART_FullScreenButton");
closeButton.PointerPressed += (sender, e) => _hostWindow.Close();
restoreButton.PointerPressed += (sender, e) => _hostWindow.WindowState = _hostWindow.WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized;
minimiseButton.PointerPressed += (sender, e) => _hostWindow.WindowState = WindowState.Minimized;
fullScreenButton.PointerPressed += (sender, e) => _hostWindow.WindowState = _hostWindow.WindowState == WindowState.FullScreen ? WindowState.Normal : WindowState.FullScreen;
closeButton.PointerReleased += (sender, e) => _hostWindow.Close();
restoreButton.PointerReleased += (sender, e) => _hostWindow.WindowState = _hostWindow.WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized;
minimiseButton.PointerReleased += (sender, e) => _hostWindow.WindowState = WindowState.Minimized;
fullScreenButton.PointerReleased += (sender, e) => _hostWindow.WindowState = _hostWindow.WindowState == WindowState.FullScreen ? WindowState.Normal : WindowState.FullScreen;
}
}
}

Loading…
Cancel
Save