Set style tag instead of using Color.fromHex in issue reporter, fixes #49409

This commit is contained in:
Rachel Macfarlane
2018-05-08 10:51:08 -07:00
parent f9367f7fb2
commit 237f2a58d4
2 changed files with 15 additions and 6 deletions

View File

@@ -42,7 +42,6 @@ import { ILogService, getLogLevel } from 'vs/platform/log/common/log';
import { OcticonLabel } from 'vs/base/browser/ui/octiconLabel/octiconLabel';
import { normalizeGitHubIssuesUrl } from 'vs/code/electron-browser/issue/issueReporterUtil';
import { Button } from 'vs/base/browser/ui/button/button';
import { Color } from 'vs/base/common/color';
const MAX_URL_LENGTH = platform.isWindows ? 2081 : 5400;
@@ -90,11 +89,7 @@ export class IssueReporter extends Disposable {
extensionsDisabled: this.environmentService.disableExtensions,
});
this.previewButton = new Button(document.getElementById('issue-reporter'), {
buttonBackground: Color.fromHex(configuration.data.styles.buttonBackground),
buttonForeground: Color.fromHex(configuration.data.styles.buttonForeground),
buttonHoverBackground: Color.fromHex(configuration.data.styles.buttonHoverBackground)
});
this.previewButton = new Button(document.getElementById('issue-reporter'));
ipcRenderer.on('issuePerformanceInfoResponse', (event, info) => {
this.logService.trace('issueReporter: Received performance data');
@@ -197,6 +192,18 @@ export class IssueReporter extends Disposable {
content.push(`::--webkit-scrollbar-thumb:hover { background-color: ${styles.sliderHoverColor}; }`);
}
if (styles.buttonBackground) {
content.push(`.monaco-text-button { background-color: ${styles.buttonBackground} !important; }`);
}
if (styles.buttonForeground) {
content.push(`.monaco-text-button { color: ${styles.buttonForeground} !important; }`);
}
if (styles.buttonHoverBackground) {
content.push(`.monaco-text-button:hover, monaco-text-button:focus { background-color: ${styles.buttonHoverBackground} !important; }`);
}
styleTag.innerHTML = content.join('\n');
document.head.appendChild(styleTag);
document.body.style.color = styles.color;