feat: Add BrowserWindow.setWindowButtonVisibility()

Fixes #12701 and supersedes #13131.

Ideally we would have added `setTitleBarStyle()`, but that is a
significantly more involved change. For example, consider the case where
we switch from `hidden` to `normal`. We would not only have to show the
traffic light buttons, we would also have to switch the window from a
frameless to a framed window and deal with various other window state.
Lets instead implement a simple solution for #12701.
This commit is contained in:
Birunthan Mohanathas 2018-07-03 10:20:56 +02:00 committed by Jeremy Apthorp
parent 00c0c180ab
commit a42ca9eecc
8 changed files with 82 additions and 7 deletions

View file

@ -119,6 +119,8 @@ class NativeWindowMac : public NativeWindow {
void ToggleTabBar() override;
bool AddTabbedWindow(NativeWindow* window) override;
bool SetWindowButtonVisibility(bool visible) override;
void SetVibrancy(const std::string& type) override;
void SetTouchBar(
const std::vector<mate::PersistentDictionary>& items) override;
@ -193,6 +195,10 @@ class NativeWindowMac : public NativeWindow {
// The "titleBarStyle" option.
TitleBarStyle title_bar_style_ = NORMAL;
// The visibility mode of window button controls when explicitly set through
// setWindowButtonVisibility().
base::Optional<bool> window_button_visibility_;
// Simple (pre-Lion) Fullscreen Settings
bool always_simple_fullscreen_ = false;
bool is_simple_fullscreen_ = false;