提交 25a57421 编写于 作者: B Benjamin Pasero

fix styles

上级 cf07c5e8
......@@ -32,6 +32,12 @@ export abstract class Part extends WorkbenchComponent {
super(id, themeService);
}
protected onThemeChange(): void {
if (this.parent) {
this.updateStyles(); // only call if our create() method has been called
}
}
/**
* Note: Clients should not call this method, the workbench calls this
* method. Calling it otherwise may result in unexpected behavior.
......
......@@ -901,7 +901,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
.div()
.addClass('content');
this.updateStyles(contentArea);
this.updateStyles();
// get settings
this.memento = this.getMemento(this.storageService, MementoScope.WORKSPACE);
......@@ -914,10 +914,9 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
return contentArea;
}
protected updateStyles(contentArea = this.getContentArea()): void {
if (contentArea) {
contentArea.style('background-color', this.getColor(editorBackground));
}
protected updateStyles(): void {
const container = this.getContainer();
container.style('background-color', this.getColor(editorBackground));
}
private onGroupFocusChanged(): void {
......
......@@ -97,15 +97,14 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
public createContentArea(parent: Builder): Builder {
const contentArea = super.createContentArea(parent);
this.updateStyles(contentArea);
this.updateStyles();
return contentArea;
}
protected updateStyles(contentArea = this.getContentArea()): void {
if (contentArea) {
contentArea.style('background-color', this.getColor(PANEL_BACKGROUND));
}
protected updateStyles(): void {
const container = this.getContainer();
container.style('background-color', this.getColor(PANEL_BACKGROUND));
}
public openPanel(id: string, focus?: boolean): TPromise<Panel> {
......
......@@ -52,7 +52,7 @@ export class WorkbenchComponent extends Disposable implements IWorkbenchComponen
// Hook up to theme changes
if (this.themeService) {
this.toUnbind.push(this.themeService.onThemeChange(() => this.updateStyles()));
this.toUnbind.push(this.themeService.onThemeChange(() => this.onThemeChange()));
}
}
......@@ -60,6 +60,10 @@ export class WorkbenchComponent extends Disposable implements IWorkbenchComponen
return this.themeService.getTheme().getColor(id).toString();
}
protected onThemeChange(): void {
this.updateStyles();
}
protected updateStyles(): void {
// Subclasses to override
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册