Merge pull request #4680 from atom/resizable-linux
Respect initial resizable window option on Linux
This commit is contained in:
commit
a9c40de393
2 changed files with 24 additions and 16 deletions
|
@ -115,6 +115,12 @@ void NativeWindow::InitFromOptions(const mate::Dictionary& options) {
|
||||||
} else {
|
} else {
|
||||||
SetSizeConstraints(size_constraints);
|
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)
|
#if defined(OS_WIN) || defined(USE_X11)
|
||||||
bool closable;
|
bool closable;
|
||||||
if (options.Get(options::kClosable, &closable)) {
|
if (options.Get(options::kClosable, &closable)) {
|
||||||
|
|
|
@ -528,6 +528,24 @@ describe('browser-window module', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('window states', function() {
|
describe('window states', function() {
|
||||||
|
describe('resizable state', function() {
|
||||||
|
it('can be changed with resizable option', function() {
|
||||||
|
w.destroy();
|
||||||
|
w = new BrowserWindow({show: false, resizable: false});
|
||||||
|
assert.equal(w.isResizable(), false);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('can be changed with setResizable method', function() {
|
||||||
|
assert.equal(w.isResizable(), true);
|
||||||
|
w.setResizable(false);
|
||||||
|
assert.equal(w.isResizable(), false);
|
||||||
|
w.setResizable(true);
|
||||||
|
assert.equal(w.isResizable(), true);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('window states (excluding Linux)', function() {
|
||||||
// Not implemented on Linux.
|
// Not implemented on Linux.
|
||||||
if (process.platform == 'linux')
|
if (process.platform == 'linux')
|
||||||
return;
|
return;
|
||||||
|
@ -625,22 +643,6 @@ describe('browser-window module', function() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('resizable state', function() {
|
|
||||||
it('can be changed with resizable option', function() {
|
|
||||||
w.destroy();
|
|
||||||
w = new BrowserWindow({show: false, resizable: false});
|
|
||||||
assert.equal(w.isResizable(), false);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('can be changed with setResizable method', function() {
|
|
||||||
assert.equal(w.isResizable(), true);
|
|
||||||
w.setResizable(false);
|
|
||||||
assert.equal(w.isResizable(), false);
|
|
||||||
w.setResizable(true);
|
|
||||||
assert.equal(w.isResizable(), true);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('hasShadow state', function() {
|
describe('hasShadow state', function() {
|
||||||
// On Window there is no shadow by default and it can not be changed
|
// On Window there is no shadow by default and it can not be changed
|
||||||
// dynamically.
|
// dynamically.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue