Skip to content

Commit

Permalink
Allow Title Bar to be Hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDrawingCoder-Gamer authored Sep 7, 2020
1 parent dafaa3b commit 10dfeb8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
23 changes: 13 additions & 10 deletions spec/main-process/atom-window.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ describe('AtomWindow', function() {
});
assert.isUndefined(w1.options.titleBarStyle);
});

it('sets frame to "false" for a hidden title bar on non-spec windows', function() {
app.config['core.titleBar'] = 'hidden';

Expand All @@ -168,15 +167,19 @@ describe('AtomWindow', function() {
assert.isUndefined(w1.options.frame);
});
} else {
it('ignores title bar style settings', function() {
for (const value of ['custom', 'custom-inset', 'hidden']) {
app.config['core.titleBar'] = value;
const { browserWindow } = new AtomWindow(app, service, {
browserWindowConstructor: StubBrowserWindow
});
assert.isUndefined(browserWindow.options.titleBarStyle);
assert.isUndefined(browserWindow.options.frame);
}
it('sets frame to "false" for a hidden title bar on non-spec windows', function() {
app.config['core.titleBar'] = 'hidden';

const { browserWindow: w0 } = new AtomWindow(app, service, {
browserWindowConstructor: StubBrowserWindow
});
assert.isFalse(w0.options.frame);

const { browserWindow: w1 } = new AtomWindow(app, service, {
browserWindowConstructor: StubBrowserWindow,
isSpec: true
});
assert.isUndefined(w1.options.frame);
});
}

Expand Down
8 changes: 7 additions & 1 deletion src/config-schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ const configSchema = {
description:
'List of names of installed packages which are not loaded at startup.'
},
titleBar: {
type: 'string',
default: 'native',
enum: ['native', 'hidden'],
description:
'Experimental: The title bar can be completely `hidden`.<br>This setting will require a relaunch of Atom to take effect.'
},
versionPinnedPackages: {
type: 'array',
default: [],
Expand Down Expand Up @@ -637,7 +644,6 @@ if (process.platform === 'darwin') {
description:
'Experimental: A `custom` title bar adapts to theme colors. Choosing `custom-inset` adds a bit more padding. The title bar can also be completely `hidden`.<br>Note: Switching to a custom or hidden title bar will compromise some functionality.<br>This setting will require a relaunch of Atom to take effect.'
};

configSchema.core.properties.simpleFullScreenWindows = {
type: 'boolean',
default: false,
Expand Down
1 change: 0 additions & 1 deletion src/main-process/atom-window.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,6 @@ module.exports = class AtomWindow extends EventEmitter {
shouldHideTitleBar() {
return (
!this.isSpec &&
process.platform === 'darwin' &&
this.atomApplication.config.get('core.titleBar') === 'hidden'
);
}
Expand Down

0 comments on commit 10dfeb8

Please sign in to comment.