mirror of
https://github.com/Microsoft/vscode
synced 2024-10-31 10:00:51 +00:00
Fix microsoft/vscode-pull-request-github#168. Use editor font for code in comments.
This commit is contained in:
parent
9714bb37b4
commit
5665c077c5
1 changed files with 16 additions and 1 deletions
|
@ -117,6 +117,7 @@ export class ReviewZoneWidget extends ZoneWidget {
|
||||||
private _commentGlyph: CommentGlyphWidget;
|
private _commentGlyph: CommentGlyphWidget;
|
||||||
private _owner: number;
|
private _owner: number;
|
||||||
private _localToDispose: IDisposable[];
|
private _localToDispose: IDisposable[];
|
||||||
|
private _globalToDispose: IDisposable[];
|
||||||
private _markdownRenderer: MarkdownRenderer;
|
private _markdownRenderer: MarkdownRenderer;
|
||||||
private _styleElement: HTMLStyleElement;
|
private _styleElement: HTMLStyleElement;
|
||||||
private _error: HTMLElement;
|
private _error: HTMLElement;
|
||||||
|
@ -145,11 +146,17 @@ export class ReviewZoneWidget extends ZoneWidget {
|
||||||
this._owner = owner;
|
this._owner = owner;
|
||||||
this._commentThread = commentThread;
|
this._commentThread = commentThread;
|
||||||
this._isCollapsed = commentThread.collapsibleState !== modes.CommentThreadCollapsibleState.Expanded;
|
this._isCollapsed = commentThread.collapsibleState !== modes.CommentThreadCollapsibleState.Expanded;
|
||||||
|
this._globalToDispose = [];
|
||||||
this._localToDispose = [];
|
this._localToDispose = [];
|
||||||
this.create();
|
this.create();
|
||||||
|
|
||||||
this._styleElement = dom.createStyleSheet(this.domNode);
|
this._styleElement = dom.createStyleSheet(this.domNode);
|
||||||
this.themeService.onThemeChange(this._applyTheme, this);
|
this._globalToDispose.push(this.themeService.onThemeChange(this._applyTheme, this));
|
||||||
|
this._globalToDispose.push(this.editor.onDidChangeConfiguration(e => {
|
||||||
|
if (e.fontInfo) {
|
||||||
|
this._applyTheme(this.themeService.getTheme());
|
||||||
|
}
|
||||||
|
}));
|
||||||
this._applyTheme(this.themeService.getTheme());
|
this._applyTheme(this.themeService.getTheme());
|
||||||
|
|
||||||
this._markdownRenderer = new MarkdownRenderer(editor, this.modeService, this.openerService);
|
this._markdownRenderer = new MarkdownRenderer(editor, this.modeService, this.openerService);
|
||||||
|
@ -627,6 +634,13 @@ export class ReviewZoneWidget extends ZoneWidget {
|
||||||
content.push(`.monaco-editor .review-widget .body .comment-form .validation-error { background: ${errorBackground}; }`);
|
content.push(`.monaco-editor .review-widget .body .comment-form .validation-error { background: ${errorBackground}; }`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const fontInfo = this.editor.getConfiguration().fontInfo;
|
||||||
|
content.push(`.monaco-editor .review-widget .body code {
|
||||||
|
font-family: ${fontInfo.fontFamily};
|
||||||
|
font-size: ${fontInfo.fontSize}px;
|
||||||
|
font-weight: ${fontInfo.fontWeight};
|
||||||
|
}`);
|
||||||
|
|
||||||
this._styleElement.innerHTML = content.join('\n');
|
this._styleElement.innerHTML = content.join('\n');
|
||||||
|
|
||||||
// Editor decorations should also be responsive to theme changes
|
// Editor decorations should also be responsive to theme changes
|
||||||
|
@ -656,6 +670,7 @@ export class ReviewZoneWidget extends ZoneWidget {
|
||||||
this._commentGlyph = null;
|
this._commentGlyph = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this._globalToDispose.forEach(global => global.dispose());
|
||||||
this._localToDispose.forEach(local => local.dispose());
|
this._localToDispose.forEach(local => local.dispose());
|
||||||
this._onDidClose.fire();
|
this._onDidClose.fire();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue