views: mac: Fix frameless window behavior (fixes issue #3189)

Frameless windows now display as expected. Default traffic light buttons can
optionally be shown at configurable vertical position. Layout respects text
direction.
This commit is contained in:
Nik Pavlov
2023-02-28 18:34:12 +00:00
committed by Marshall Greenblatt
parent 42f351a40d
commit 276423dcfb
22 changed files with 579 additions and 57 deletions

View File

@@ -128,6 +128,29 @@ class CefWindowDelegate : public CefPanelDelegate {
/*--cef()--*/
virtual bool IsFrameless(CefRefPtr<CefWindow> window) { return false; }
///
/// Return true if |window| should be created with standard window buttons
/// like close, minimize and zoom.
///
/*--cef()--*/
virtual bool WithStandardWindowButtons(CefRefPtr<CefWindow> window) {
return false;
}
///
/// Return whether the titlebar height should be overridden,
/// and sets the height of the titlebar in |titlebar_height|.
/// On macOS, it can also be used to adjust the vertical position
/// of the traffic light buttons in frameless windows.
/// The buttons will be positioned halfway down the titlebar
/// at a height of |titlebar_height| / 2.
///
/*--cef()--*/
virtual bool GetTitlebarHeight(CefRefPtr<CefWindow> window,
float* titlebar_height) {
return false;
}
///
/// Return true if |window| can be resized.
///