From de4b5be4c64ab82cc32c82f1fd729fbfbe23e3a9 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 12 Jul 2017 08:57:37 +0200 Subject: [PATCH] Move our watermark to resources so that distro can pick it up (#30256) * move watermark to resources folder * add to build * :lipstick: * update distro * update distro --- build/gulpfile.vscode.js | 3 ++ package.json | 2 +- resources/letterpress-dark.svg | 33 +++++++++++++++++++ resources/letterpress-hc.svg | 33 +++++++++++++++++++ resources/letterpress.svg | 31 +++++++++++++++++ .../browser/parts/editor/editorPart.ts | 15 ++++++++- .../browser/parts/editor/media/editorpart.css | 24 ++------------ .../parts/editor/media/letterpress-dark.svg | 1 - .../parts/editor/media/letterpress-hc.svg | 1 - .../parts/editor/media/letterpress.svg | 1 - 10 files changed, 118 insertions(+), 26 deletions(-) create mode 100644 resources/letterpress-dark.svg create mode 100644 resources/letterpress-hc.svg create mode 100644 resources/letterpress.svg delete mode 100644 src/vs/workbench/browser/parts/editor/media/letterpress-dark.svg delete mode 100644 src/vs/workbench/browser/parts/editor/media/letterpress-hc.svg delete mode 100644 src/vs/workbench/browser/parts/editor/media/letterpress.svg diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js index feff102ea13..9366af86b61 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js @@ -283,6 +283,8 @@ function packageTask(platform, arch, opts) { const license = gulp.src(['LICENSES.chromium.html', 'LICENSE.txt', 'ThirdPartyNotices.txt', 'licenses/**'], { base: '.' }); + const watermark = gulp.src(['resources/letterpress.svg', 'resources/letterpress-dark.svg', 'resources/letterpress-hc.svg'], { base: '.' }); + // TODO the API should be copied to `out` during compile, not here const api = gulp.src('src/vs/vscode.d.ts').pipe(rename('out/vs/vscode.d.ts')); @@ -306,6 +308,7 @@ function packageTask(platform, arch, opts) { packageJsonStream, productJsonStream, license, + watermark, api, sources, deps diff --git a/package.json b/package.json index b004e23178f..d04eb9cb0a0 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "code-oss-dev", "version": "1.15.0", "electronVersion": "1.6.6", - "distro": "3d527860a13c6374d293f95ac2b8d26338d5f428", + "distro": "01a59e58dc560865433d23039da2ad82638444a5", "author": { "name": "Microsoft Corporation" }, diff --git a/resources/letterpress-dark.svg b/resources/letterpress-dark.svg new file mode 100644 index 00000000000..5d6fca4300c --- /dev/null +++ b/resources/letterpress-dark.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/letterpress-hc.svg b/resources/letterpress-hc.svg new file mode 100644 index 00000000000..94cbfbd81e3 --- /dev/null +++ b/resources/letterpress-hc.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/letterpress.svg b/resources/letterpress.svg new file mode 100644 index 00000000000..86f01932099 --- /dev/null +++ b/resources/letterpress.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/vs/workbench/browser/parts/editor/editorPart.ts b/src/vs/workbench/browser/parts/editor/editorPart.ts index bbb9c345a6f..6c625a26b61 100644 --- a/src/vs/workbench/browser/parts/editor/editorPart.ts +++ b/src/vs/workbench/browser/parts/editor/editorPart.ts @@ -41,6 +41,9 @@ import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/c import { IThemeService } from 'vs/platform/theme/common/themeService'; import { editorBackground } from 'vs/platform/theme/common/colorRegistry'; import { EDITOR_GROUP_BACKGROUND } from 'vs/workbench/common/theme'; +import { createCSSRule } from "vs/base/browser/dom"; +import { IEnvironmentService } from "vs/platform/environment/common/environment"; +import { join } from "vs/base/common/paths"; class ProgressMonitor { @@ -122,7 +125,8 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService @IConfigurationService private configurationService: IConfigurationService, @IContextKeyService contextKeyService: IContextKeyService, @IInstantiationService private instantiationService: IInstantiationService, - @IThemeService themeService: IThemeService + @IThemeService themeService: IThemeService, + @IEnvironmentService private environmentService: IEnvironmentService ) { super(id, { hasTitle: false }, themeService); @@ -172,9 +176,18 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService this.revealIfOpen = false; } + this.initStyles(); this.registerListeners(); } + private initStyles(): void { + + // Letterpress Background when Empty + createCSSRule('.vs .monaco-workbench > .part.editor.empty', `background-image: url('${join(this.environmentService.appRoot, 'resources/letterpress.svg')}')`); + createCSSRule('.vs-dark .monaco-workbench > .part.editor.empty', `background-image: url('${join(this.environmentService.appRoot, 'resources/letterpress-dark.svg')}')`); + createCSSRule('.hc-black .monaco-workbench > .part.editor.empty', `background-image: url('${join(this.environmentService.appRoot, 'resources/letterpress-hc.svg')}')`); + } + private registerListeners(): void { this.toUnbind.push(this.stacks.onEditorDirty(identifier => this.onEditorDirty(identifier))); this.toUnbind.push(this.stacks.onEditorDisposed(identifier => this.onEditorDisposed(identifier))); diff --git a/src/vs/workbench/browser/parts/editor/media/editorpart.css b/src/vs/workbench/browser/parts/editor/media/editorpart.css index be300080fdd..2af9d3061b9 100644 --- a/src/vs/workbench/browser/parts/editor/media/editorpart.css +++ b/src/vs/workbench/browser/parts/editor/media/editorpart.css @@ -3,27 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -.monaco-workbench > .part.editor { +/** Letter press styling for empty editor */ +.monaco-workbench > .part.editor.empty { background-repeat: no-repeat; background-position: 50% 50%; -} - -.monaco-workbench > .part.editor.empty { - background-image: url('letterpress.svg'); -} - -.vs-dark .monaco-workbench > .part.editor.empty { - background-image: url('letterpress-dark.svg'); -} - -.hc-black .monaco-workbench > .part.editor.empty { - background-image: url('letterpress-hc.svg'); -} - -@media -(-webkit-min-device-pixel-ratio: 2), -(min-resolution: 192dppx) { - .monaco-workbench > .part.editor { - background-size: 260px 260px; - } + background-size: 260px 260px; } \ No newline at end of file diff --git a/src/vs/workbench/browser/parts/editor/media/letterpress-dark.svg b/src/vs/workbench/browser/parts/editor/media/letterpress-dark.svg deleted file mode 100644 index 5cd4a656db5..00000000000 --- a/src/vs/workbench/browser/parts/editor/media/letterpress-dark.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/browser/parts/editor/media/letterpress-hc.svg b/src/vs/workbench/browser/parts/editor/media/letterpress-hc.svg deleted file mode 100644 index 38b46ee704a..00000000000 --- a/src/vs/workbench/browser/parts/editor/media/letterpress-hc.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/vs/workbench/browser/parts/editor/media/letterpress.svg b/src/vs/workbench/browser/parts/editor/media/letterpress.svg deleted file mode 100644 index 41a76de75b0..00000000000 --- a/src/vs/workbench/browser/parts/editor/media/letterpress.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file