Skip to content

Commit 4626bc0

Browse files
authored
Merge pull request microsoft#61965 from usernamehw/align-badge-color
Align badge theming with the GUI badge
2 parents 4cb80de + cdd3c60 commit 4626bc0

2 files changed

Lines changed: 4 additions & 11 deletions

File tree

src/vs/workbench/parts/preferences/browser/preferencesEditor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ export class PreferencesEditor extends BaseEditor {
269269
this.sideBySidePreferencesWidget.setResultCount(count.target, count.count);
270270
} else if (this.searchWidget.getValue()) {
271271
if (countValue === 0) {
272-
this.searchWidget.showMessage(nls.localize('noSettingsFound', "No Results"), countValue);
272+
this.searchWidget.showMessage(nls.localize('noSettingsFound', "No Settings Found"), countValue);
273273
} else if (countValue === 1) {
274274
this.searchWidget.showMessage(nls.localize('oneSettingFound', "1 Setting Found"), countValue);
275275
} else {

src/vs/workbench/parts/preferences/browser/preferencesWidgets.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { ConfigurationTarget } from 'vs/platform/configuration/common/configurat
2525
import { IContextKey } from 'vs/platform/contextkey/common/contextkey';
2626
import { IContextMenuService, IContextViewService } from 'vs/platform/contextview/browser/contextView';
2727
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
28-
import { activeContrastBorder, badgeBackground, badgeForeground, contrastBorder, errorForeground, focusBorder } from 'vs/platform/theme/common/colorRegistry';
28+
import { activeContrastBorder, badgeBackground, badgeForeground, contrastBorder, focusBorder } from 'vs/platform/theme/common/colorRegistry';
2929
import { attachInputBoxStyler, attachStylerCallback } from 'vs/platform/theme/common/styler';
3030
import { ICssStyleCollector, ITheme, IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
3131
import { IWorkspaceContextService, IWorkspaceFolder, WorkbenchState } from 'vs/platform/workspace/common/workspace';
@@ -614,7 +614,8 @@ export class SearchWidget extends Widget {
614614
this.countElement.style.borderStyle = border ? 'solid' : null;
615615
this.countElement.style.borderColor = border;
616616

617-
this.styleCountElementForeground();
617+
const color = this.themeService.getTheme().getColor(badgeForeground);
618+
this.countElement.style.color = color ? color.toString() : null;
618619
}));
619620
}
620621

@@ -650,18 +651,10 @@ export class SearchWidget extends Widget {
650651
if (this.countElement && message !== this.countElement.textContent) {
651652
this.countElement.textContent = message;
652653
this.inputBox.inputElement.setAttribute('aria-label', message);
653-
DOM.toggleClass(this.countElement, 'no-results', count === 0);
654654
this.inputBox.inputElement.style.paddingRight = this.getControlsWidth() + 'px';
655-
this.styleCountElementForeground();
656655
}
657656
}
658657

659-
private styleCountElementForeground() {
660-
const colorId = DOM.hasClass(this.countElement, 'no-results') ? errorForeground : badgeForeground;
661-
const color = this.themeService.getTheme().getColor(colorId);
662-
this.countElement.style.color = color ? color.toString() : null;
663-
}
664-
665658
public layout(dimension: DOM.Dimension) {
666659
if (dimension.width < 400) {
667660
if (this.countElement) {

0 commit comments

Comments
 (0)