mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
Status bar: setting invalid color sets opacity 100%. Fixes #115292
This commit is contained in:
parent
b8bff49c9a
commit
e86befc8a9
|
@ -894,7 +894,7 @@ class StatusbarEntryItem extends Disposable {
|
|||
}
|
||||
|
||||
private applyColor(container: HTMLElement, color: string | ThemeColor | undefined, isBackground?: boolean): void {
|
||||
let colorResult: string | null = null;
|
||||
let colorResult: string | undefined = undefined;
|
||||
|
||||
if (isBackground) {
|
||||
this.backgroundListener.clear();
|
||||
|
@ -904,15 +904,15 @@ class StatusbarEntryItem extends Disposable {
|
|||
|
||||
if (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 colorValue = (theme.getColor(color.id) || Color.transparent).toString();
|
||||
const colorValue = theme.getColor(color.id)?.toString();
|
||||
|
||||
if (isBackground) {
|
||||
container.style.backgroundColor = colorValue;
|
||||
container.style.backgroundColor = colorValue ?? '';
|
||||
} else {
|
||||
container.style.color = colorValue;
|
||||
container.style.color = colorValue ?? '';
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -927,9 +927,9 @@ class StatusbarEntryItem extends Disposable {
|
|||
}
|
||||
|
||||
if (isBackground) {
|
||||
container.style.backgroundColor = colorResult || '';
|
||||
container.style.backgroundColor = colorResult ?? '';
|
||||
} else {
|
||||
container.style.color = colorResult || '';
|
||||
container.style.color = colorResult ?? '';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue