提交 8b17abaf 编写于 作者: B Benjamin Pasero

themes: also need to be stored on main side

上级 24bf3b56
......@@ -136,7 +136,7 @@ export interface IWindowConfiguration extends env.ICommandLineArguments {
export class VSCodeWindow {
public static menuBarHiddenKey = 'menuBarHidden';
public static themeStorageKey = 'theme'; // TODO@Ben this key is only used to find out if a window can be shown instantly because of light theme, remove once we have support for bg color
public static themeStorageKey = 'theme';
private static MIN_WIDTH = 200;
private static MIN_HEIGHT = 120;
......
......@@ -328,6 +328,10 @@ export class WindowsManager {
if (broadcast.channel && broadcast.payload) {
env.log('IPC#vscode:broadcast', target, broadcast.channel, broadcast.payload);
// Handle specific events on main side
this.onBroadcast(broadcast.channel, broadcast.payload);
// Send to windows
if (target) {
const otherWindowsWithTarget = WindowsManager.WINDOWS.filter(w => w.id !== windowId && typeof w.openedWorkspacePath === 'string');
const directTargetMatch = otherWindowsWithTarget.filter(w => this.isPathEqual(target, w.openedWorkspacePath));
......@@ -435,6 +439,14 @@ export class WindowsManager {
});
}
private onBroadcast(event: string, payload: any): void {
// Theme changes
if (event === 'vscode:changeTheme' && typeof payload === 'string') {
storage.setItem(window.VSCodeWindow.themeStorageKey, payload);
}
}
public reload(win: window.VSCodeWindow, cli?: env.ICommandLineArguments): void {
// Only reload when the window has not vetoed this
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册