diff --git a/atom/browser/native_window_mac.h b/atom/browser/native_window_mac.h index 6bd2c69ed4d5..7c4d2b4eef2f 100644 --- a/atom/browser/native_window_mac.h +++ b/atom/browser/native_window_mac.h @@ -117,7 +117,7 @@ class NativeWindowMac : public NativeWindow, }; TitleBarStyle title_bar_style() const { return title_bar_style_; } - bool zoom_to_content_size() const { return zoom_to_content_size_; } + bool zoom_to_page_width() const { return zoom_to_page_width_; } protected: // Return a vector of non-draggable regions that fill a window of size @@ -157,7 +157,7 @@ class NativeWindowMac : public NativeWindow, bool is_kiosk_; - bool zoom_to_content_size_; + bool zoom_to_page_width_; NSInteger attention_request_id_; // identifier from requestUserAttention diff --git a/atom/browser/native_window_mac.mm b/atom/browser/native_window_mac.mm index 69dd29b4f0b5..23cb80b183f6 100644 --- a/atom/browser/native_window_mac.mm +++ b/atom/browser/native_window_mac.mm @@ -106,7 +106,7 @@ bool ScopedDisableResize::disable_resize_ = false; // menu) to determine the "standard size" of the window. - (NSRect)windowWillUseStandardFrame:(NSWindow*)window defaultFrame:(NSRect)frame { - if (!shell_->zoom_to_content_size()) + if (!shell_->zoom_to_page_width()) return frame; // If the shift key is down, maximize. @@ -630,7 +630,7 @@ NativeWindowMac::NativeWindowMac( NativeWindow* parent) : NativeWindow(web_contents, options, parent), is_kiosk_(false), - zoom_to_content_size_(false), + zoom_to_page_width_(false), attention_request_id_(0), title_bar_style_(NORMAL) { int width = 800, height = 600; @@ -753,7 +753,7 @@ NativeWindowMac::NativeWindowMac( if (!has_frame() || !use_content_size) SetSize(gfx::Size(width, height)); - options.Get(options::kZoomToContentSize, &zoom_to_content_size_); + options.Get(options::kZoomToPageWidth, &zoom_to_page_width_); // Enable the NSView to accept first mouse event. bool acceptsFirstMouse = false; diff --git a/atom/common/options_switches.cc b/atom/common/options_switches.cc index eab2cf8145e5..70aeccfc9bc7 100644 --- a/atom/common/options_switches.cc +++ b/atom/common/options_switches.cc @@ -45,8 +45,8 @@ const char kAcceptFirstMouse[] = "acceptFirstMouse"; // Whether window size should include window frame. const char kUseContentSize[] = "useContentSize"; -// Whether window zoom should be to content size. -const char kZoomToContentSize[] = "zoomToContentSize"; +// Whether window zoom should be to page width. +const char kZoomToPageWidth[] = "zoomToPageWidth"; // The requested title bar style for the window const char kTitleBarStyle[] = "titleBarStyle"; diff --git a/atom/common/options_switches.h b/atom/common/options_switches.h index fcd98550b0a6..3c9abebf4ce4 100644 --- a/atom/common/options_switches.h +++ b/atom/common/options_switches.h @@ -34,7 +34,7 @@ extern const char kKiosk[]; extern const char kAlwaysOnTop[]; extern const char kAcceptFirstMouse[]; extern const char kUseContentSize[]; -extern const char kZoomToContentSize[]; +extern const char kZoomToPageWidth[]; extern const char kTitleBarStyle[]; extern const char kAutoHideMenuBar[]; extern const char kEnableLargerThanScreen[]; diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index 32f991f36b87..5305d1ffafce 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -205,7 +205,7 @@ It creates a new `BrowserWindow` with native properties as set by the `options`. * `vibrancy` String - Add a type of vibrancy effect to the window, only on macOS. Can be `appearance-based`, `light`, `dark`, `titlebar`, `selection`, `menu`, `popover`, `sidebar`, `medium-light` or `ultra-dark`. - * `zoomToContentSize` Boolean - The zoom behavior on macOS, accessible by + * `zoomToPageWidth` Boolean - The zoom behavior on macOS, accessible by option-clicking the green stoplight button on the toolbar or running the Window > Zoom menu item. If `true`, the window will grow to the width of the web page, `false` will cause it to zoom to the width of the screen. This