mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
Load/Unload theme without restarting (#2458)
This commit is contained in:
parent
a59ccc3ff4
commit
d148c486f5
2 changed files with 9 additions and 2 deletions
|
|
@ -36,6 +36,11 @@ module.exports = class Window {
|
|||
const rpc = createRPC(window);
|
||||
const sessions = new Map();
|
||||
|
||||
const updateBackgroundColor = () => {
|
||||
const cfg_ = app.plugins.getDecoratedConfig();
|
||||
window.setBackgroundColor(toElectronBackgroundColor(cfg_.backgroundColor || '#000'));
|
||||
};
|
||||
|
||||
// config changes
|
||||
const cfgUnsubscribe = app.config.subscribe(() => {
|
||||
const cfg_ = app.plugins.getDecoratedConfig();
|
||||
|
|
@ -49,11 +54,12 @@ module.exports = class Window {
|
|||
}
|
||||
|
||||
// update background color if necessary
|
||||
updateBackgroundColor();
|
||||
|
||||
cfg = cfg_;
|
||||
});
|
||||
|
||||
rpc.on('init', () => {
|
||||
window.setBackgroundColor(toElectronBackgroundColor(cfg.backgroundColor || '#000'));
|
||||
window.show();
|
||||
|
||||
// If no callback is passed to createWindow,
|
||||
|
|
@ -234,6 +240,7 @@ module.exports = class Window {
|
|||
if (!err) {
|
||||
load();
|
||||
window.webContents.send('plugins change');
|
||||
updateBackgroundColor();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ const reducer = (state = initial, action) => {
|
|||
ret.backgroundColor = config.backgroundColor;
|
||||
}
|
||||
|
||||
if (config.css) {
|
||||
if (config.css || config.css === '') {
|
||||
ret.css = config.css;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue