diff --git a/src/sql/parts/notebook/cellViews/code.component.html b/src/sql/parts/notebook/cellViews/code.component.html index cde7270c06..f7b12f94ce 100644 --- a/src/sql/parts/notebook/cellViews/code.component.html +++ b/src/sql/parts/notebook/cellViews/code.component.html @@ -5,7 +5,7 @@ *--------------------------------------------------------------------------------------------*/ -->
-
+
diff --git a/src/sql/parts/notebook/cellViews/code.css b/src/sql/parts/notebook/cellViews/code.css index e8cadbfbd0..8785f88552 100644 --- a/src/sql/parts/notebook/cellViews/code.css +++ b/src/sql/parts/notebook/cellViews/code.css @@ -13,3 +13,24 @@ code-component .toolbar { border-right-width: 1px; border-right-style: solid; } + +code-component .toolbarIconRun { + height: 20px; + background-image: url('../media/light/execute_cell.svg'); + padding-bottom: 10px; +} + +.vs-dark code-component .toolbarIconRun, +.hc-black code-component .toolbarIconRun { + background-image: url('../media/dark/execute_cell_inverse.svg'); +} + +code-component .carbon-taskbar .icon { + background-size: 20px; + width: 40px; +} + +code-component .carbon-taskbar.monaco-toolbar .monaco-action-bar.animated .actions-container +{ + padding-left: 10px +} \ No newline at end of file diff --git a/src/sql/parts/notebook/cellViews/codeActions.ts b/src/sql/parts/notebook/cellViews/codeActions.ts index 48ae4a7283..292bd506e8 100644 --- a/src/sql/parts/notebook/cellViews/codeActions.ts +++ b/src/sql/parts/notebook/cellViews/codeActions.ts @@ -2,12 +2,10 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ + import { Action } from 'vs/base/common/actions'; import { TPromise } from 'vs/base/common/winjs.base'; -import { SelectBox } from 'sql/base/browser/ui/selectBox/selectBox'; -import { IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview'; -import { ISelectBoxOptions } from 'vs/base/browser/ui/selectBox/selectBox'; -import { TaskHistoryViewlet } from 'sql/parts/taskHistory/viewlet/taskHistoryViewlet'; +import { localize } from 'vs/nls'; export class RunCellAction extends Action { public static ID = 'jobaction.notebookRunCell'; @@ -15,7 +13,8 @@ export class RunCellAction extends Action { constructor( ) { - super(RunCellAction.ID, RunCellAction.LABEL, 'newStepIcon'); + super(RunCellAction.ID, '', 'toolbarIconRun'); + this.tooltip = localize('runCell','Run cell'); } public run(context: any): TPromise { diff --git a/src/sql/parts/notebook/media/dark/execute_cell_inverse.svg b/src/sql/parts/notebook/media/dark/execute_cell_inverse.svg new file mode 100644 index 0000000000..ddddf779bc --- /dev/null +++ b/src/sql/parts/notebook/media/dark/execute_cell_inverse.svg @@ -0,0 +1 @@ +execute_cell_inverse \ No newline at end of file diff --git a/src/sql/parts/notebook/media/light/execute_cell.svg b/src/sql/parts/notebook/media/light/execute_cell.svg new file mode 100644 index 0000000000..2a8f889c1e --- /dev/null +++ b/src/sql/parts/notebook/media/light/execute_cell.svg @@ -0,0 +1 @@ +execute_cell \ No newline at end of file diff --git a/src/sql/parts/notebook/models/notebookModel.ts b/src/sql/parts/notebook/models/notebookModel.ts index 1ed36f6e58..17520a2899 100644 --- a/src/sql/parts/notebook/models/notebookModel.ts +++ b/src/sql/parts/notebook/models/notebookModel.ts @@ -21,6 +21,7 @@ import { SparkMagicContexts } from 'sql/parts/notebook/models/sparkMagicContexts import { IConnectionProfile } from 'sql/parts/connection/common/interfaces'; import { NotebookConnection } from 'sql/parts/notebook/models/notebookConnection'; import { INotification, Severity } from 'vs/platform/notification/common/notification'; +import { Schemas } from 'vs/base/common/network'; /* * Used to control whether a message in a dialog/wizard is displayed as an error, @@ -183,7 +184,10 @@ export class NotebookModel extends Disposable implements INotebookModel { public async requestModelLoad(isTrusted: boolean = false): Promise { try { this._trustedMode = isTrusted; - let contents = await this.notebookManager.contentManager.getNotebookContents(this.notebookOptions.notebookUri); + let contents = null; + if(this.notebookOptions.notebookUri.scheme !== Schemas.untitled) { + contents = await this.notebookManager.contentManager.getNotebookContents(this.notebookOptions.notebookUri); + } let factory = this.notebookOptions.factory; // if cells already exist, create them with language info (if it is saved) this._cells = undefined; diff --git a/src/sql/parts/notebook/notebook.contribution.ts b/src/sql/parts/notebook/notebook.contribution.ts index a4d097345a..e2dfce84e0 100644 --- a/src/sql/parts/notebook/notebook.contribution.ts +++ b/src/sql/parts/notebook/notebook.contribution.ts @@ -71,4 +71,3 @@ actionRegistry.registerWorkbenchAction( OpenNotebookAction.LABEL ); - diff --git a/src/sql/parts/notebook/notebook.css b/src/sql/parts/notebook/notebook.css index c57d838ede..efcfbc6bca 100644 --- a/src/sql/parts/notebook/notebook.css +++ b/src/sql/parts/notebook/notebook.css @@ -25,6 +25,10 @@ align-items: center; } +.notebookEditor .actionbar-container .monaco-action-bar > ul.actions-container { + padding-top: 0px; +} + .notebookEditor .notebook-info-button { display: inline-block; width: 100%;