Skip to content
This repository has been archived by the owner on Jun 20, 2018. It is now read-only.

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Oleksii Orel <oorel@redhat.com>
  • Loading branch information
olexii4 committed Jun 1, 2018
1 parent 4f17ead commit 1a51216
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
20 changes: 7 additions & 13 deletions packages/plugin-ext/src/plugin/status-bar/status-bar-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*/
import {StatusBarItem} from '@theia/plugin';
import * as theia from '@theia/plugin';
import {ThemeColor, StatusBarAlignment} from '../types-impl';
import {StatusBarMessageRegistryMain} from "../../api/plugin-api";
import {StatusBarMessageRegistryMain} from '../../api/plugin-api';
import {VS_COLORS} from './vscolor-const';

export class StatusBarItemImpl implements StatusBarItem {
export class StatusBarItemImpl implements theia.StatusBarItem {
private _messageId: string;
private _alignment: StatusBarAlignment;
private _priority: number;
Expand All @@ -31,8 +32,8 @@ export class StatusBarItemImpl implements StatusBarItem {
this._priority = priority;
}

public get alignment(): StatusBarAlignment {
return this._alignment;
public get alignment(): theia.StatusBarAlignment {
return <theia.StatusBarAlignment>this._alignment;
}

public get priority(): number {
Expand Down Expand Up @@ -122,14 +123,7 @@ export class StatusBarItemImpl implements StatusBarItem {
private getColor(): string | undefined {
if (typeof this.color !== 'string') {
const colorId = (<ThemeColor>this.color).id;
// TODO implement ThemeColor for vs (redo it)
const vsColorMap: Map<string, string> = new Map([
['statusBar.foreground', '--theia-layout-color4'],
['editorOverviewRuler.errorForeground', '--theia-error-color0'],
['editorOverviewRuler.warningForeground', '--theia-warn-color0'],
['editorOverviewRuler.infoForeground', '--theia-info-color0'],
]);
return `var(${vsColorMap.has(colorId) ? vsColorMap.get(colorId) : colorId})`;
return `var(${VS_COLORS[colorId] ? VS_COLORS[colorId] : colorId})`;
}
return this.color;
}
Expand Down
12 changes: 12 additions & 0 deletions packages/plugin-ext/src/plugin/status-bar/vscolor-const.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright (C) 2018 Red Hat, Inc. and others.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*/
export const VS_COLORS: {[vsColorId: string]: string} = {
'statusBar.foreground': '--theia-layout-color4',
'editorOverviewRuler.errorForeground': '--theia-error-color0',
'editorOverviewRuler.warningForeground': '--theia-warn-color0',
'editorOverviewRuler.infoForeground': '--theia-info-color0'
};

0 comments on commit 1a51216

Please sign in to comment.