mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-11 11:15:24 +03:00
src: Allow windows to be transparent, behind a pref (off by default)
Add a `core.allowWindowTransparency` pref (off by default). Sets `options.transparent = true` for the `browserWindow` `options` when this pref is enabled. Requires a restart to activate. Co-credit to savetheclocktower for the revised description of the pref. Co-authored-by: Andrew Dupont <github@andrewdupont.net>
This commit is contained in:
parent
a6fe2bcf3c
commit
6220705884
@ -399,6 +399,12 @@ const configSchema = {
|
||||
description: 'Add the current tab title to the Pulsar Window title.',
|
||||
type: 'boolean',
|
||||
default: true
|
||||
},
|
||||
allowWindowTransparency: {
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
title: 'Allow Window Transparency',
|
||||
description: `Allows editor windows to be see-through. When this setting is enabled, UI themes and user stylesheets can use background colors with an alpha channel to make editor windows translucent. Takes effect after a restart of Pulsar.`
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -285,6 +285,9 @@ module.exports = class AtomApplication extends EventEmitter {
|
||||
this.config.onDidChange('core.colorProfile', () =>
|
||||
this.promptForRestart()
|
||||
);
|
||||
this.config.onDidChange('core.allowWindowTransparency', () =>
|
||||
this.promptForRestart()
|
||||
);
|
||||
});
|
||||
await this.configFilePromise;
|
||||
}
|
||||
|
@ -80,6 +80,10 @@ module.exports = class AtomWindow extends EventEmitter {
|
||||
options.titleBarStyle = 'hiddenInset';
|
||||
if (this.shouldHideTitleBar()) options.frame = false;
|
||||
|
||||
if(this.atomApplication.config.get('core.allowWindowTransparency')){
|
||||
options.transparent = true;
|
||||
}
|
||||
|
||||
const BrowserWindowConstructor =
|
||||
settings.browserWindowConstructor || BrowserWindow;
|
||||
this.browserWindow = new BrowserWindowConstructor(options);
|
||||
|
Loading…
Reference in New Issue
Block a user