Skip to content

Commit

Permalink
Use theme styling
Browse files Browse the repository at this point in the history
  • Loading branch information
sandy081 committed Jan 23, 2019
1 parent 471a3ff commit 0cb9100
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { IExtensionManagementServerService, IExtensionTipsService } from 'vs/pla
import { ILabelService } from 'vs/platform/label/common/label';
import { extensionButtonProminentBackground, extensionButtonProminentForeground } from 'vs/workbench/parts/extensions/electron-browser/extensionsActions';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { STATUS_BAR_PROMINENT_ITEM_BACKGROUND } from 'vs/workbench/common/theme';

export abstract class ExtensionWidget extends Disposable implements IExtensionContainer {
private _extension: IExtension;
Expand Down Expand Up @@ -201,6 +202,7 @@ export class RemoteBadgeWidget extends ExtensionWidget {
constructor(
private parent: HTMLElement,
@ILabelService private readonly labelService: ILabelService,
@IThemeService private readonly themeService: IThemeService,
@IExtensionManagementServerService private readonly extensionManagementServerService: IExtensionManagementServerService,
) {
super();
Expand All @@ -226,7 +228,12 @@ export class RemoteBadgeWidget extends ExtensionWidget {
this.element = append(this.parent, $('div.extension-remote-badge'));
append(this.element, $('span.octicon.octicon-file-symlink-directory'));

this.element.style.backgroundColor = 'rgb(56, 138, 52)';
const applyBadgeStyle = () => {
const bgColor = this.themeService.getTheme().getColor(STATUS_BAR_PROMINENT_ITEM_BACKGROUND);
this.element.style.backgroundColor = bgColor ? bgColor.toString() : '';
};
applyBadgeStyle();
this.themeService.onThemeChange(applyBadgeStyle, this, this.disposables);

const updateTitle = () => this.element.title = this.labelService.getHostLabel();
this.labelService.onDidChangeFormatters(() => updateTitle(), this, this.disposables);
Expand Down

0 comments on commit 0cb9100

Please sign in to comment.