From ba324c4f9bc3ce9646160f108b6e2a00011f2815 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Wed, 29 Nov 2017 21:31:18 +0100 Subject: [PATCH] Improve profiling animation, open editor when done --- .../media/runtimeExtensionsEditor.css | 24 +++++++++++-------- .../runtimeExtensionsEditor.ts | 12 ++++++---- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/runtimeExtensionsEditor.css b/src/vs/workbench/parts/extensions/electron-browser/media/runtimeExtensionsEditor.css index 091ef8c1f78..6da9720409e 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/media/runtimeExtensionsEditor.css +++ b/src/vs/workbench/parts/extensions/electron-browser/media/runtimeExtensionsEditor.css @@ -68,6 +68,8 @@ .vs-dark .monaco-action-bar .extension-host-profile-stop, .hc-black .monaco-action-bar .extension-host-profile-stop { background: url('profile-stop-inverse.svg') center center no-repeat; + animation:fade 1000ms infinite; + -webkit-animation:fade 1000ms infinite; } .runtime-extensions-editor .monaco-action-bar { @@ -88,20 +90,22 @@ background: url('profile-stop.svg') no-repeat; display: inline-block; padding-right: 2px; + padding-bottom: 2px; width: 16px; height: 16px; vertical-align: middle; - animation: blink 1s step-start 0s infinite; - -webkit-animation: blink 1s step-start 0s infinite; + animation:fade 1000ms infinite; + -webkit-animation:fade 1000ms infinite; } -@keyframes blink { - 50% { - opacity: 0.0; - } +@keyframes fade { + from { opacity: 1.0; } + 50% { opacity: 0.5; } + to { opacity: 1.0; } } -@-webkit-keyframes blink { - 50% { - opacity: 0.0; - } + +@-webkit-keyframes fade { + from { opacity: 1.0; } + 50% { opacity: 0.5; } + to { opacity: 1.0; } } \ No newline at end of file diff --git a/src/vs/workbench/parts/extensions/electron-browser/runtimeExtensionsEditor.ts b/src/vs/workbench/parts/extensions/electron-browser/runtimeExtensionsEditor.ts index 823ba4d02b6..981d4d6a3ae 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/runtimeExtensionsEditor.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/runtimeExtensionsEditor.ts @@ -86,6 +86,7 @@ export class RuntimeExtensionsEditor extends BaseEditor { @IContextMenuService private readonly _contextMenuService: IContextMenuService, @IWindowService private readonly _windowService: IWindowService, @IEnvironmentService private readonly _environmentService: IEnvironmentService, + @IInstantiationService private readonly _instantiationService: IInstantiationService, ) { super(RuntimeExtensionsEditor.ID, telemetryService, themeService); @@ -419,7 +420,7 @@ export class RuntimeExtensionsEditor extends BaseEditor { @memoize private get extensionHostProfileAction(): IAction { - return new ExtensionHostProfileAction(ExtensionHostProfileAction.LABEL_START, ExtensionHostProfileAction.ID, this, this._extensionService); + return this._instantiationService.createInstance(ExtensionHostProfileAction, ExtensionHostProfileAction.LABEL_START, ExtensionHostProfileAction.ID, this); } public layout(dimension: Dimension): void { @@ -538,6 +539,8 @@ class ExtensionHostProfileAction extends Action { id: string = ExtensionHostProfileAction.ID, label: string = ExtensionHostProfileAction.LABEL_START, private readonly _parentEditor: RuntimeExtensionsEditor, @IExtensionService private readonly _extensionService: IExtensionService, + @IWorkbenchEditorService private readonly _editorService: IWorkbenchEditorService, + @IInstantiationService private readonly _instantiationService: IInstantiationService, ) { super(id, label, ExtensionHostProfileAction.START_CSS_CLASS); this._profileSession = null; @@ -550,6 +553,7 @@ class ExtensionHostProfileAction extends Action { this.label = ExtensionHostProfileAction.LABEL_STOP; ProfileExtHostStatusbarItem.instance.show(() => { this.run(); + this._editorService.openEditor(this._instantiationService.createInstance(RuntimeExtensionsInput)); }); } else { this.class = ExtensionHostProfileAction.START_CSS_CLASS; @@ -603,7 +607,6 @@ export class ProfileExtHostStatusbarItem implements IStatusbarItem { public static instance: ProfileExtHostStatusbarItem; private toDispose: IDisposable[]; - private container: HTMLElement; private statusBarItem: HTMLElement; private label: HTMLElement; private timeStarted: number; @@ -635,9 +638,8 @@ export class ProfileExtHostStatusbarItem implements IStatusbarItem { } public render(container: HTMLElement): IDisposable { - this.container = container; - if (!this.statusBarItem && this.container) { - this.statusBarItem = append(this.container, $('.profileExtHost-statusbar-item')); + if (!this.statusBarItem && container) { + this.statusBarItem = append(container, $('.profileExtHost-statusbar-item')); this.toDispose.push(addDisposableListener(this.statusBarItem, 'click', () => { if (this.clickHandler) { this.clickHandler(); -- GitLab