Skip to content

Commit dc619de

Browse files
authored
Icons in problems view show black when not focused (#174487)
* Icons in problems view show black when not focused * update smoke test
1 parent e577973 commit dc619de

4 files changed

Lines changed: 15 additions & 8 deletions

File tree

src/vs/platform/severityIcon/browser/media/severityIcon.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
.monaco-editor .zone-widget .codicon.codicon-error,
7-
.markers-panel .marker-icon.codicon.codicon-error,
7+
.markers-panel .marker-icon.error, .markers-panel .marker-icon .codicon.codicon-error,
88
.text-search-provider-messages .providerMessage .codicon.codicon-error,
99
.extensions-viewlet > .extensions .codicon.codicon-error,
1010
.extension-editor .codicon.codicon-error,
@@ -13,7 +13,7 @@
1313
}
1414

1515
.monaco-editor .zone-widget .codicon.codicon-warning,
16-
.markers-panel .marker-icon.codicon.codicon-warning,
16+
.markers-panel .marker-icon.warning, .markers-panel .marker-icon .codicon.codicon-warning,
1717
.text-search-provider-messages .providerMessage .codicon.codicon-warning,
1818
.extensions-viewlet > .extensions .codicon.codicon-warning,
1919
.extension-editor .codicon.codicon-warning,
@@ -22,7 +22,7 @@
2222
}
2323

2424
.monaco-editor .zone-widget .codicon.codicon-info,
25-
.markers-panel .marker-icon.codicon.codicon-info,
25+
.markers-panel .marker-icon.info, .markers-panel .marker-icon .codicon.codicon-info,
2626
.text-search-provider-messages .providerMessage .codicon.codicon-info,
2727
.extensions-viewlet > .extensions .codicon.codicon-info,
2828
.extension-editor .codicon.codicon-info,

src/vs/workbench/contrib/markers/browser/markersTreeViewer.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/c
5050
import { MarkersContextKeys, MarkersViewMode } from 'vs/workbench/contrib/markers/common/markers';
5151
import { unsupportedSchemas } from 'vs/platform/markers/common/markerService';
5252
import { defaultCountBadgeStyles } from 'vs/platform/theme/browser/defaultStyles';
53+
import Severity from 'vs/base/common/severity';
5354

5455
interface IResourceMarkersTemplateData {
5556
readonly resourceLabel: IResourceLabel;
@@ -270,6 +271,7 @@ class MarkerWidget extends Disposable {
270271

271272
private readonly actionBar: ActionBar;
272273
private readonly icon: HTMLElement;
274+
private readonly iconContainer: HTMLElement;
273275
private readonly messageAndDetailsContainer: HTMLElement;
274276
private readonly disposables = this._register(new DisposableStore());
275277

@@ -283,7 +285,12 @@ class MarkerWidget extends Disposable {
283285
this.actionBar = this._register(new ActionBar(dom.append(parent, dom.$('.actions')), {
284286
actionViewItemProvider: (action: IAction) => action.id === QuickFixAction.ID ? _instantiationService.createInstance(QuickFixActionViewItem, <QuickFixAction>action) : undefined
285287
}));
286-
this.icon = dom.append(parent, dom.$(''));
288+
289+
// wrap the icon in a container that get the icon color as foreground color. That way, if the
290+
// list view does not have a specific color for the icon (=the color variable is invalid) it
291+
// falls back to the foreground color of container (inherit)
292+
this.iconContainer = dom.append(parent, dom.$(''));
293+
this.icon = dom.append(this.iconContainer, dom.$(''));
287294
this.messageAndDetailsContainer = dom.append(parent, dom.$('.marker-message-details-container'));
288295
}
289296

@@ -292,7 +299,8 @@ class MarkerWidget extends Disposable {
292299
this.disposables.clear();
293300
dom.clearNode(this.messageAndDetailsContainer);
294301

295-
this.icon.className = `marker-icon codicon ${SeverityIcon.className(MarkerSeverity.toSeverity(element.marker.severity))}`;
302+
this.iconContainer.className = `marker-icon ${Severity.toString(MarkerSeverity.toSeverity(element.marker.severity))}`;
303+
this.icon.className = `codicon ${SeverityIcon.className(MarkerSeverity.toSeverity(element.marker.severity))}`;
296304
this.renderQuickfixActionbar(element);
297305

298306
this.renderMessageAndDetails(element, filterData);

src/vs/workbench/contrib/markers/browser/markersView.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,8 +478,7 @@ export class MarkersView extends FilterViewPane implements IMarkersView {
478478
}),
479479
expandOnlyOnTwistieClick: (e: MarkerElement) => e instanceof Marker && e.relatedInformation.length > 0,
480480
overrideStyles: {
481-
listBackground: this.getBackgroundColor(),
482-
listInactiveSelectionIconForeground: undefined // we don't want to override the severity icon color
481+
listBackground: this.getBackgroundColor()
483482
},
484483
selectionNavigation: true,
485484
multipleSelectionSupport: true,

test/automation/src/problems.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class Problems {
3333

3434
static getSelectorInProblemsView(problemType: ProblemSeverity): string {
3535
const selector = problemType === ProblemSeverity.WARNING ? 'codicon-warning' : 'codicon-error';
36-
return `div[id="workbench.panel.markers"] .monaco-tl-contents .marker-icon.${selector}`;
36+
return `div[id="workbench.panel.markers"] .monaco-tl-contents .marker-icon .${selector}`;
3737
}
3838

3939
static getSelectorInEditor(problemType: ProblemSeverity): string {

0 commit comments

Comments
 (0)