Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align badge theming with the GUI badge #61965

Merged
merged 2 commits into from
Oct 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ export class PreferencesEditor extends BaseEditor {
this.sideBySidePreferencesWidget.setResultCount(count.target, count.count);
} else if (this.searchWidget.getValue()) {
if (countValue === 0) {
this.searchWidget.showMessage(nls.localize('noSettingsFound', "No Results"), countValue);
this.searchWidget.showMessage(nls.localize('noSettingsFound', "No Settings Found"), countValue);
} else if (countValue === 1) {
this.searchWidget.showMessage(nls.localize('oneSettingFound', "1 Setting Found"), countValue);
} else {
Expand Down
13 changes: 3 additions & 10 deletions src/vs/workbench/parts/preferences/browser/preferencesWidgets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { ConfigurationTarget } from 'vs/platform/configuration/common/configurat
import { IContextKey } from 'vs/platform/contextkey/common/contextkey';
import { IContextMenuService, IContextViewService } from 'vs/platform/contextview/browser/contextView';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { activeContrastBorder, badgeBackground, badgeForeground, contrastBorder, errorForeground, focusBorder } from 'vs/platform/theme/common/colorRegistry';
import { activeContrastBorder, badgeBackground, badgeForeground, contrastBorder, focusBorder } from 'vs/platform/theme/common/colorRegistry';
import { attachInputBoxStyler, attachStylerCallback } from 'vs/platform/theme/common/styler';
import { ICssStyleCollector, ITheme, IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
import { IWorkspaceContextService, IWorkspaceFolder, WorkbenchState } from 'vs/platform/workspace/common/workspace';
Expand Down Expand Up @@ -614,7 +614,8 @@ export class SearchWidget extends Widget {
this.countElement.style.borderStyle = border ? 'solid' : null;
this.countElement.style.borderColor = border;

this.styleCountElementForeground();
const color = this.themeService.getTheme().getColor(badgeForeground);
this.countElement.style.color = color ? color.toString() : null;
}));
}

Expand Down Expand Up @@ -650,18 +651,10 @@ export class SearchWidget extends Widget {
if (this.countElement && message !== this.countElement.textContent) {
this.countElement.textContent = message;
this.inputBox.inputElement.setAttribute('aria-label', message);
DOM.toggleClass(this.countElement, 'no-results', count === 0);
this.inputBox.inputElement.style.paddingRight = this.getControlsWidth() + 'px';
this.styleCountElementForeground();
}
}

private styleCountElementForeground() {
const colorId = DOM.hasClass(this.countElement, 'no-results') ? errorForeground : badgeForeground;
const color = this.themeService.getTheme().getColor(colorId);
this.countElement.style.color = color ? color.toString() : null;
}

public layout(dimension: DOM.Dimension) {
if (dimension.width < 400) {
if (this.countElement) {
Expand Down