diff --git a/src/vs/workbench/parts/tasks/electron-browser/media/task.contribution.css b/src/vs/workbench/parts/tasks/electron-browser/media/task.contribution.css
index a4d20c5c828..12d82a1a957 100644
--- a/src/vs/workbench/parts/tasks/electron-browser/media/task.contribution.css
+++ b/src/vs/workbench/parts/tasks/electron-browser/media/task.contribution.css
@@ -94,14 +94,14 @@
.monaco-workbench .task-action { background: url('update.svg') center center no-repeat; }
-.no-telemetry {
+.task-panel-no-telemetry {
background-image: url('thumbs-down.svg');
width: 50px;
height: 50px;
vertical-align: middle;
}
-.yes-telemetry {
+.task-panel-yes-telemetry {
background-image: url('thumbs-up.svg');
width: 50px;
height: 50px;
@@ -121,7 +121,7 @@
margin-top: 10px;
}
-.task-item {
+.task-panel-example-item {
outline: grey solid thin;
padding-left: 5px;
padding-right: 5px;
@@ -129,34 +129,34 @@
margin-bottom: 10px;
}
-.mockup-button {
+.task-panel-mockup-button {
display: inline-block;
padding: 2px;
}
-.oneliner {
+.task-panel-oneliner {
text-align: left;
margin: 10px;
}
-.right-aligned {
+.task-panel-right-aligned {
float: right;
}
-.centered {
+.task-panel-centered {
text-align: center;
margin-top: 10px;
}
-.header-item {
- font-size: large;
+.task-panel-header-item {
+ font-size: 19px;
transition: display 2s linear 500ms;
}
-.feedback {
+.task-panel-feedback {
font-size: smaller;
}
-.hidden {
+.task-panel-hidden {
display: none;
}
diff --git a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts
index 699f62634c0..bf8da6b58a5 100644
--- a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts
+++ b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts
@@ -92,7 +92,7 @@ import { IThemeService } from 'vs/platform/theme/common/themeService';
let $ = Builder.$;
let tasksCategory = nls.localize('tasksCategory', "Tasks");
-export abstract class OpenTaskConfigurationAction extends Action {
+abstract class OpenTaskConfigurationAction extends Action {
constructor(id: string, label: string,
private taskService: ITaskService,
@@ -195,7 +195,7 @@ export abstract class OpenTaskConfigurationAction extends Action {
}
}
-export class ConfigureTaskRunnerAction extends OpenTaskConfigurationAction {
+class ConfigureTaskRunnerAction extends OpenTaskConfigurationAction {
public static ID = 'workbench.action.tasks.configureTaskRunner';
public static TEXT = nls.localize('ConfigureTaskRunnerAction.label', "Configure Task Runner");
@@ -210,11 +210,10 @@ export class ConfigureTaskRunnerAction extends OpenTaskConfigurationAction {
super(id, label, taskService, configurationService, editorService, fileService, contextService,
outputService, messageService, quickOpenService, environmentService, configurationResolverService,
extensionService);
- this.class = 'task-action configure';
}
}
-export class ConfigureBuildTaskAction extends OpenTaskConfigurationAction {
+class ConfigureBuildTaskAction extends OpenTaskConfigurationAction {
public static ID = 'workbench.action.tasks.configureBuildTask';
public static TEXT = nls.localize('ConfigureBuildTaskAction.label', "Configure Build Task");
diff --git a/src/vs/workbench/parts/tasks/electron-browser/taskButtons.ts b/src/vs/workbench/parts/tasks/electron-browser/taskButtons.ts
deleted file mode 100644
index 02542c6036b..00000000000
--- a/src/vs/workbench/parts/tasks/electron-browser/taskButtons.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-/*---------------------------------------------------------------------------------------------
- * Copyright (c) Microsoft Corporation. All rights reserved.
- * Licensed under the MIT License. See License.txt in the project root for license information.
- *--------------------------------------------------------------------------------------------*/
-'use strict';
-
-export function domElement() {
- return `
-
-
-
-
Some things you might be able to do here:
-
- - See a list of autodetected and manually configured tasks
- - Run/Restart/Stop tasks with a click of a button
- - Show a summary of each completed task (ie: execution time, exit code, foldable output)
- - Configure a task without touching the json file
-
-
Here's a rough idea of what a task item might look like. By no means is this the final layout so please do not judge the look.
-
-
Task1: tsc -watch Running (0 Errors)
- Show Output
- Stop
- Restart
-
-
-
If you are interested in further discussion or have feedback of your own, please go the github issue here.
-
-
-
-
-
-
-`;
-};
\ No newline at end of file
diff --git a/src/vs/workbench/parts/tasks/electron-browser/taskPanel.ts b/src/vs/workbench/parts/tasks/electron-browser/taskPanel.ts
index 243c643c0a4..26f609b9f72 100644
--- a/src/vs/workbench/parts/tasks/electron-browser/taskPanel.ts
+++ b/src/vs/workbench/parts/tasks/electron-browser/taskPanel.ts
@@ -8,16 +8,14 @@ import * as nls from 'vs/nls';
import dom = require('vs/base/browser/dom');
import URI from 'vs/base/common/uri';
import { Builder, Dimension } from 'vs/base/browser/builder';
-import { IAction } from 'vs/base/common/actions';
import { Panel, PanelRegistry, PanelDescriptor, Extensions } from 'vs/workbench/browser/panel';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
-import { IThemeService } from 'vs/platform/theme/common/themeService';
+import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService';
import { ITaskService } from 'vs/workbench/parts/tasks/common/taskService';
import { Registry } from 'vs/platform/registry/common/platform';
import { TPromise } from 'vs/base/common/winjs.base';
import { ICommandService } from 'vs/platform/commands/common/commands';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
-import { domElement } from 'vs/workbench/parts/tasks/electron-browser/taskButtons';
import { buttonBackground, buttonForeground, textLinkForeground, selectBackground } from 'vs/platform/theme/common/colorRegistry';
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
import { IOpenerService } from 'vs/platform/opener/common/opener';
@@ -26,11 +24,10 @@ const TASK_PANEL_ID = 'workbench.panel.task';
export class TaskPanel extends Panel {
- private _actions: IAction[];
private taskExperimentPart5 = 'workbench.tasks.feedbackAnswered';
+ private _builder;
constructor(
-
@ITelemetryService telemetryService: ITelemetryService,
@IThemeService protected themeService: IThemeService,
@ITaskService private taskService: ITaskService,
@@ -38,7 +35,6 @@ export class TaskPanel extends Panel {
@ICommandService private commandService: ICommandService,
@IStorageService private storageService: IStorageService,
@IOpenerService private openerService: IOpenerService,
-
) {
super(TASK_PANEL_ID, telemetryService, themeService);
}
@@ -47,35 +43,25 @@ export class TaskPanel extends Panel {
super.create(parent);
dom.addClass(parent.getHTMLElement(), 'task-panel');
- let builder = parent.innerHtml(domElement());
- let buttons = builder.select('.mockup-button');
- let links = builder.select('.linkstyle');
- let taskItems = builder.select('.task-item');
- let yesButton = builder.select('.yes-telemetry');
- let noButton = builder.select('.no-telemetry');
- let githubLink = builder.select('.linkstyle');
- let clickFeedback = builder.select('.header-item');
- let thanks = builder.select('.thanks');
+ this._builder = parent.innerHtml(getHtml());
+ const yesButton = this._builder.select('.task-panel-yes-telemetry');
+ const noButton = this._builder.select('.task-panel-no-telemetry');
+ const githubLink = this._builder.select('.task-panel-linkstyle');
+ const clickFeedback = this._builder.select('.task-panel-header-item');
+ const thanks = this._builder.select('.task-panel-thanks');
- buttons.style('background-color', this.themeService.getTheme().getColor(buttonBackground).toString());
- buttons.style('color', this.themeService.getTheme().getColor(buttonForeground).toString());
- links.style('color', this.themeService.getTheme().getColor(textLinkForeground).toString());
- taskItems.style('background-color', this.themeService.getTheme().getColor(selectBackground).toString());
-
- this.themeService.onThemeChange(() => {
- buttons.style('background-color', this.themeService.getTheme().getColor(buttonBackground).toString());
- buttons.style('color', this.themeService.getTheme().getColor(buttonForeground).toString());
- links.style('color', this.themeService.getTheme().getColor(textLinkForeground).toString());
- taskItems.style('background-color', this.themeService.getTheme().getColor(selectBackground).toString());
- });
+ if (this.storageService.get(this.taskExperimentPart5)) {
+ clickFeedback.addClass('task-panel-hidden');
+ thanks.removeClass('task-panel-hidden');
+ }
yesButton.item(0).on('click', e => {
if (!this.storageService.get(this.taskExperimentPart5)) {
this.telemetryService.publicLog('taskPanel.yes');
this.storageService.store(this.taskExperimentPart5, true, StorageScope.GLOBAL);
}
- clickFeedback.addClass('hidden');
- thanks.removeClass('hidden');
+ clickFeedback.addClass('task-panel-hidden');
+ thanks.removeClass('task-panel-hidden');
});
noButton.item(0).on('click', e => {
@@ -83,44 +69,37 @@ export class TaskPanel extends Panel {
this.telemetryService.publicLog('taskPanel.no');
this.storageService.store(this.taskExperimentPart5, true, StorageScope.GLOBAL);
}
- clickFeedback.addClass('hidden');
- thanks.removeClass('hidden');
+ clickFeedback.addClass('task-panel-hidden');
+ thanks.removeClass('task-panel-hidden');
});
githubLink.item(0).on('click', e => {
- let node = event.target as HTMLAnchorElement;
+ const node = event.target as HTMLAnchorElement;
if (node.href) {
this.openerService.open(URI.parse(node.href));
}
});
+ this._register(this.themeService.onThemeChange(theme => this._updateTheme(theme)));
+ this._updateTheme();
return TPromise.as(void 0);
}
- public layout(dimension?: Dimension): void {
- if (!dimension) {
- return;
+ public layout(dimension?: Dimension): void { }
+
+ private _updateTheme(theme?: ITheme): void {
+ const githubLink = this._builder.select('.task-panel-linkstyle');
+ const buttons = this._builder.select('.task-panel-mockup-button');
+ const taskItems = this._builder.select('.task-panel-example-item');
+
+ if (!theme) {
+ theme = this.themeService.getTheme();
}
+ buttons.style('background-color', theme.getColor(buttonBackground).toString());
+ buttons.style('color', theme.getColor(buttonForeground).toString());
+ githubLink.style('color', theme.getColor(textLinkForeground).toString());
+ taskItems.style('background-color', theme.getColor(selectBackground).toString());
}
-
- public getActions(): IAction[] {
- if (!this._actions) {
- this._actions = [
- //this._instantiationService.createInstance(ConfigureTaskRunnerAction, ConfigureTaskRunnerAction.ID, ConfigureTaskRunnerAction.TEXT),
- ];
- this._actions.forEach(a => {
- this._register(a);
- });
- }
- return this._actions;
- }
-
- public setVisible(visible: boolean): TPromise {
- return super.setVisible(visible);
- };
-
- public focus(): void {
- };
}
(Registry.as(Extensions.Panels)).registerPanel(new PanelDescriptor(
@@ -131,3 +110,37 @@ export class TaskPanel extends Panel {
'task',
50
));
+
+function getHtml() {
+ return `
+
+
+
Some things you might be able to do here:
+
+ - See a list of autodetected and manually configured tasks
+ - Run/Restart/Stop tasks with a click of a button
+ - Show a summary of each completed task (ie: execution time, exit code, foldable output)
+ - Configure a task without touching the json file
+
+
Here's a rough idea of what a task item might look like. By no means is this the final layout so please do not judge the look.
+
+
Task1: tsc -watch Running (0 Errors)
+ Show Output
+ Stop
+ Restart
+
+
+
If you are interested in further discussion or have feedback of your own, please go the github issue
+ here.
+
+
+
+
+
+
+
+`;
+};
\ No newline at end of file