mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Set resizable on Linux from InitWithOptions
This commit is contained in:
@@ -115,6 +115,12 @@ void NativeWindow::InitFromOptions(const mate::Dictionary& options) {
|
||||
} else {
|
||||
SetSizeConstraints(size_constraints);
|
||||
}
|
||||
#if defined(USE_X11)
|
||||
bool resizable;
|
||||
if (options.Get(options::kResizable, &resizable)) {
|
||||
SetResizable(resizable);
|
||||
}
|
||||
#endif
|
||||
#if defined(OS_WIN) || defined(USE_X11)
|
||||
bool closable;
|
||||
if (options.Get(options::kClosable, &closable)) {
|
||||
|
||||
@@ -120,7 +120,6 @@ NativeWindowViews::NativeWindowViews(
|
||||
minimizable_(true) {
|
||||
options.Get(options::kTitle, &title_);
|
||||
options.Get(options::kAutoHideMenuBar, &menu_bar_autohide_);
|
||||
options.Get(options::kResizable, &resizable_);
|
||||
|
||||
#if defined(OS_WIN)
|
||||
// On Windows we rely on the CanResize() to indicate whether window can be
|
||||
@@ -218,12 +217,6 @@ NativeWindowViews::NativeWindowViews(
|
||||
std::string window_type;
|
||||
if (options.Get(options::kType, &window_type))
|
||||
SetWindowType(GetAcceleratedWidget(), window_type);
|
||||
|
||||
if (!resizable_) {
|
||||
gfx::Size content_size = GetContentSize();
|
||||
SetContentSizeConstraints(
|
||||
extensions::SizeConstraints(content_size, content_size));
|
||||
}
|
||||
#endif
|
||||
|
||||
// Add web view.
|
||||
|
||||
Reference in New Issue
Block a user