Skip to content

Commit

Permalink
add a possibility to set an entry color for each status bar item
Browse files Browse the repository at this point in the history
Signed-off-by: Oleksii Orel <oorel@redhat.com>
  • Loading branch information
olexii4 authored and evidolob committed May 25, 2018
1 parent ef000bd commit 0b0d02e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/core/src/browser/status-bar/status-bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { VirtualRenderer, VirtualWidget } from '../widgets';
import { CommandService } from '../../common';
import { h } from '@phosphor/virtualdom';
import { h , ElementInlineStyle } from '@phosphor/virtualdom';
import { LabelParser, LabelIcon } from '../label-parser';
import { injectable, inject } from 'inversify';
import { FrontendApplicationStateService } from '../frontend-application-state';
Expand All @@ -26,6 +26,7 @@ export interface StatusBarEntry {
*/
text: string;
alignment: StatusBarAlignment;
color?: string;
tooltip?: string;
command?: string;
// tslint:disable-next-line:no-any
Expand All @@ -38,6 +39,7 @@ export enum StatusBarAlignment {
}

export interface StatusBarEntryAttributes {
style?: ElementInlineStyle;
className?: string;
title?: string;
onclick?: () => void;
Expand Down Expand Up @@ -137,6 +139,12 @@ export class StatusBarImpl extends VirtualWidget implements StatusBar {
attrs.title = entry.tooltip;
}

if (entry.color) {
attrs.style = {
color: entry.color
};
}

return attrs;
}

Expand Down

0 comments on commit 0b0d02e

Please sign in to comment.