提交 e86befc8 编写于 作者: M Martin Aeschlimann

Status bar: setting invalid color sets opacity 100%. Fixes #115292

上级 b8bff49c
...@@ -894,7 +894,7 @@ class StatusbarEntryItem extends Disposable { ...@@ -894,7 +894,7 @@ class StatusbarEntryItem extends Disposable {
} }
private applyColor(container: HTMLElement, color: string | ThemeColor | undefined, isBackground?: boolean): void { private applyColor(container: HTMLElement, color: string | ThemeColor | undefined, isBackground?: boolean): void {
let colorResult: string | null = null; let colorResult: string | undefined = undefined;
if (isBackground) { if (isBackground) {
this.backgroundListener.clear(); this.backgroundListener.clear();
...@@ -904,15 +904,15 @@ class StatusbarEntryItem extends Disposable { ...@@ -904,15 +904,15 @@ class StatusbarEntryItem extends Disposable {
if (color) { if (color) {
if (isThemeColor(color)) { if (isThemeColor(color)) {
colorResult = (this.themeService.getColorTheme().getColor(color.id) || Color.transparent).toString(); colorResult = this.themeService.getColorTheme().getColor(color.id)?.toString();
const listener = this.themeService.onDidColorThemeChange(theme => { const listener = this.themeService.onDidColorThemeChange(theme => {
const colorValue = (theme.getColor(color.id) || Color.transparent).toString(); const colorValue = theme.getColor(color.id)?.toString();
if (isBackground) { if (isBackground) {
container.style.backgroundColor = colorValue; container.style.backgroundColor = colorValue ?? '';
} else { } else {
container.style.color = colorValue; container.style.color = colorValue ?? '';
} }
}); });
...@@ -927,9 +927,9 @@ class StatusbarEntryItem extends Disposable { ...@@ -927,9 +927,9 @@ class StatusbarEntryItem extends Disposable {
} }
if (isBackground) { if (isBackground) {
container.style.backgroundColor = colorResult || ''; container.style.backgroundColor = colorResult ?? '';
} else { } else {
container.style.color = colorResult || ''; container.style.color = colorResult ?? '';
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册