osx: Set resizable flag when creating window
Setting resizable for frameless window before it is shown will change its size.
This commit is contained in:
parent
6fea6cf58a
commit
898db4d6bd
2 changed files with 8 additions and 1 deletions
|
@ -134,10 +134,12 @@ void NativeWindow::InitFromOptions(const mate::Dictionary& options) {
|
||||||
} else {
|
} else {
|
||||||
SetSizeConstraints(size_constraints);
|
SetSizeConstraints(size_constraints);
|
||||||
}
|
}
|
||||||
|
#if defined(OS_WIN) || defined(USE_X11)
|
||||||
bool resizable;
|
bool resizable;
|
||||||
if (options.Get(switches::kResizable, &resizable)) {
|
if (options.Get(switches::kResizable, &resizable)) {
|
||||||
SetResizable(resizable);
|
SetResizable(resizable);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
bool top;
|
bool top;
|
||||||
if (options.Get(switches::kAlwaysOnTop, &top) && top) {
|
if (options.Get(switches::kAlwaysOnTop, &top) && top) {
|
||||||
SetAlwaysOnTop(true);
|
SetAlwaysOnTop(true);
|
||||||
|
|
|
@ -350,6 +350,8 @@ NativeWindowMac::NativeWindowMac(
|
||||||
|
|
||||||
bool useStandardWindow = true;
|
bool useStandardWindow = true;
|
||||||
options.Get(switches::kStandardWindow, &useStandardWindow);
|
options.Get(switches::kStandardWindow, &useStandardWindow);
|
||||||
|
bool resizable = true;
|
||||||
|
options.Get(switches::kResizable, &resizable);
|
||||||
|
|
||||||
// New title bar styles are available in Yosemite or newer
|
// New title bar styles are available in Yosemite or newer
|
||||||
std::string titleBarStyle;
|
std::string titleBarStyle;
|
||||||
|
@ -357,10 +359,13 @@ NativeWindowMac::NativeWindowMac(
|
||||||
options.Get(switches::kTitleBarStyle, &titleBarStyle);
|
options.Get(switches::kTitleBarStyle, &titleBarStyle);
|
||||||
|
|
||||||
NSUInteger styleMask = NSTitledWindowMask | NSClosableWindowMask |
|
NSUInteger styleMask = NSTitledWindowMask | NSClosableWindowMask |
|
||||||
NSMiniaturizableWindowMask | NSResizableWindowMask;
|
NSMiniaturizableWindowMask;
|
||||||
if (!useStandardWindow || transparent() || !has_frame()) {
|
if (!useStandardWindow || transparent() || !has_frame()) {
|
||||||
styleMask |= NSTexturedBackgroundWindowMask;
|
styleMask |= NSTexturedBackgroundWindowMask;
|
||||||
}
|
}
|
||||||
|
if (resizable) {
|
||||||
|
styleMask |= NSResizableWindowMask;
|
||||||
|
}
|
||||||
if ((titleBarStyle == "hidden") || (titleBarStyle == "hidden-inset")) {
|
if ((titleBarStyle == "hidden") || (titleBarStyle == "hidden-inset")) {
|
||||||
styleMask |= NSFullSizeContentViewWindowMask;
|
styleMask |= NSFullSizeContentViewWindowMask;
|
||||||
styleMask |= NSUnifiedTitleAndToolbarWindowMask;
|
styleMask |= NSUnifiedTitleAndToolbarWindowMask;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue