Merge pull request #9788 from shubham2892/Add-option-to-show-title-text-in-titlebar-in-fullscreen

Add alwaysShowTitleTextInFullscreen flag
This commit is contained in:
Kevin Sawicki 2017-07-14 11:58:12 -07:00 committed by GitHub
commit 5581d1d652
5 changed files with 19 additions and 2 deletions

View file

@ -133,6 +133,8 @@ class NativeWindowMac : public NativeWindow,
bool zoom_to_page_width() const { return zoom_to_page_width_; } bool zoom_to_page_width() const { return zoom_to_page_width_; }
bool fullscreen_window_title() const { return fullscreen_window_title_; }
protected: protected:
// Return a vector of non-draggable regions that fill a window of size // Return a vector of non-draggable regions that fill a window of size
// |width| by |height|, but leave gaps where the window should be draggable. // |width| by |height|, but leave gaps where the window should be draggable.
@ -177,6 +179,8 @@ class NativeWindowMac : public NativeWindow,
bool zoom_to_page_width_; bool zoom_to_page_width_;
bool fullscreen_window_title_;
NSInteger attention_request_id_; // identifier from requestUserAttention NSInteger attention_request_id_; // identifier from requestUserAttention
// The presentation options before entering kiosk mode. // The presentation options before entering kiosk mode.

View file

@ -355,7 +355,9 @@ bool ScopedDisableResize::disable_resize_ = false;
base::mac::IsAtLeastOS10_10() && base::mac::IsAtLeastOS10_10() &&
// FIXME(zcbenz): Showing titlebar for hiddenInset window is weird under // FIXME(zcbenz): Showing titlebar for hiddenInset window is weird under
// fullscreen mode. // fullscreen mode.
shell_->title_bar_style() != atom::NativeWindowMac::HIDDEN_INSET) { // Show title if fullscreen_window_title flag is set
(shell_->title_bar_style() != atom::NativeWindowMac::HIDDEN_INSET ||
shell_->fullscreen_window_title())) {
[window setTitleVisibility:NSWindowTitleVisible]; [window setTitleVisibility:NSWindowTitleVisible];
} }
@ -379,7 +381,8 @@ bool ScopedDisableResize::disable_resize_ = false;
NSWindow* window = shell_->GetNativeWindow(); NSWindow* window = shell_->GetNativeWindow();
if ((shell_->transparent() || !shell_->has_frame()) && if ((shell_->transparent() || !shell_->has_frame()) &&
base::mac::IsAtLeastOS10_10() && base::mac::IsAtLeastOS10_10() &&
shell_->title_bar_style() != atom::NativeWindowMac::HIDDEN_INSET) { (shell_->title_bar_style() != atom::NativeWindowMac::HIDDEN_INSET ||
shell_->fullscreen_window_title())) {
[window setTitleVisibility:NSWindowTitleHidden]; [window setTitleVisibility:NSWindowTitleHidden];
} }
@ -814,6 +817,7 @@ NativeWindowMac::NativeWindowMac(
is_kiosk_(false), is_kiosk_(false),
was_fullscreen_(false), was_fullscreen_(false),
zoom_to_page_width_(false), zoom_to_page_width_(false),
fullscreen_window_title_(false),
attention_request_id_(0), attention_request_id_(0),
title_bar_style_(NORMAL) { title_bar_style_(NORMAL) {
int width = 800, height = 600; int width = 800, height = 600;
@ -959,6 +963,8 @@ NativeWindowMac::NativeWindowMac(
options.Get(options::kZoomToPageWidth, &zoom_to_page_width_); options.Get(options::kZoomToPageWidth, &zoom_to_page_width_);
options.Get(options::kFullscreenWindowTitle, &fullscreen_window_title_);
// Enable the NSView to accept first mouse event. // Enable the NSView to accept first mouse event.
bool acceptsFirstMouse = false; bool acceptsFirstMouse = false;
options.Get(options::kAcceptFirstMouse, &acceptsFirstMouse); options.Get(options::kAcceptFirstMouse, &acceptsFirstMouse);

View file

@ -48,6 +48,9 @@ const char kUseContentSize[] = "useContentSize";
// Whether window zoom should be to page width. // Whether window zoom should be to page width.
const char kZoomToPageWidth[] = "zoomToPageWidth"; const char kZoomToPageWidth[] = "zoomToPageWidth";
// Whether always show title text in full screen is enabled.
const char kFullscreenWindowTitle[] = "fullscreenWindowTitle";
// The requested title bar style for the window // The requested title bar style for the window
const char kTitleBarStyle[] = "titleBarStyle"; const char kTitleBarStyle[] = "titleBarStyle";

View file

@ -35,6 +35,7 @@ extern const char kAlwaysOnTop[];
extern const char kAcceptFirstMouse[]; extern const char kAcceptFirstMouse[];
extern const char kUseContentSize[]; extern const char kUseContentSize[];
extern const char kZoomToPageWidth[]; extern const char kZoomToPageWidth[];
extern const char kFullscreenWindowTitle[];
extern const char kTitleBarStyle[]; extern const char kTitleBarStyle[];
extern const char kTabbingIdentifier[]; extern const char kTabbingIdentifier[];
extern const char kAutoHideMenuBar[]; extern const char kAutoHideMenuBar[];

View file

@ -225,6 +225,9 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
display unless hovered over in the top left of the window. These custom display unless hovered over in the top left of the window. These custom
buttons prevent issues with mouse events that occur with the standard buttons prevent issues with mouse events that occur with the standard
window toolbar buttons. **Note:** This option is currently experimental. window toolbar buttons. **Note:** This option is currently experimental.
* `fullscreenWindowTitle` Boolean (optional) - Shows the title in the
tile bar in full screen mode on macOS for all `titleBarStyle` options.
Default is `false`.
* `thickFrame` Boolean (optional) - Use `WS_THICKFRAME` style for frameless windows on * `thickFrame` Boolean (optional) - Use `WS_THICKFRAME` style for frameless windows on
Windows, which adds standard window frame. Setting it to `false` will remove Windows, which adds standard window frame. Setting it to `false` will remove
window shadow and window animations. Default is `true`. window shadow and window animations. Default is `true`.