From 6e142bc42bb9502b32a2ea648e7b23322149f69a Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Wed, 13 Feb 2019 18:16:34 +0100 Subject: [PATCH] Fix theme picker on install --- .../electron-browser/extensionsActions.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/vs/workbench/contrib/extensions/electron-browser/extensionsActions.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensionsActions.ts index 2a19a01cf48..3ad8e9ca688 100644 --- a/src/vs/workbench/contrib/extensions/electron-browser/extensionsActions.ts +++ b/src/vs/workbench/contrib/extensions/electron-browser/extensionsActions.ts @@ -190,12 +190,12 @@ export class InstallAction extends ExtensionAction { if (SetColorThemeAction.getColorThemes(colorThemes, this.extension).length) { const action = this.instantiationService.createInstance(SetColorThemeAction, colorThemes); action.extension = extension; - return action.run(true); + return action.run({ showCurrentTheme: true, ignoreFocusLost: true }); } if (SetFileIconThemeAction.getFileIconThemes(fileIconThemes, this.extension).length) { const action = this.instantiationService.createInstance(SetFileIconThemeAction, fileIconThemes); action.extension = extension; - return action.run(true); + return action.run({ showCurrentTheme: true, ignoreFocusLost: true }); } } } @@ -1158,7 +1158,7 @@ export class SetColorThemeAction extends ExtensionAction { this.class = this.enabled ? SetColorThemeAction.EnabledClass : SetColorThemeAction.DisabledClass; } - async run(showCurrentTheme: boolean): Promise { + async run({ showCurrentTheme, ignoreFocusLost }: { showCurrentTheme: boolean, ignoreFocusLost: boolean } = { showCurrentTheme: false, ignoreFocusLost: false }): Promise { this.update(); if (!this.enabled) { return; @@ -1181,7 +1181,8 @@ export class SetColorThemeAction extends ExtensionAction { picks, { placeHolder: localize('select color theme', "Select Color Theme"), - onDidFocus: item => delayer.trigger(() => this.workbenchThemeService.setColorTheme(item.id, undefined)) + onDidFocus: item => delayer.trigger(() => this.workbenchThemeService.setColorTheme(item.id, undefined)), + ignoreFocusLost }); let confValue = this.configurationService.inspect(COLOR_THEME_SETTING); const target = typeof confValue.workspace !== 'undefined' ? ConfigurationTarget.WORKSPACE : ConfigurationTarget.USER; @@ -1229,7 +1230,7 @@ export class SetFileIconThemeAction extends ExtensionAction { this.class = this.enabled ? SetFileIconThemeAction.EnabledClass : SetFileIconThemeAction.DisabledClass; } - async run(showCurrentTheme: boolean): Promise { + async run({ showCurrentTheme, ignoreFocusLost }: { showCurrentTheme: boolean, ignoreFocusLost: boolean } = { showCurrentTheme: false, ignoreFocusLost: false }): Promise { await this.update(); if (!this.enabled) { return; @@ -1252,7 +1253,8 @@ export class SetFileIconThemeAction extends ExtensionAction { picks, { placeHolder: localize('select file icon theme', "Select File Icon Theme"), - onDidFocus: item => delayer.trigger(() => this.workbenchThemeService.setFileIconTheme(item.id, undefined)) + onDidFocus: item => delayer.trigger(() => this.workbenchThemeService.setFileIconTheme(item.id, undefined)), + ignoreFocusLost }); let confValue = this.configurationService.inspect(ICON_THEME_SETTING); const target = typeof confValue.workspace !== 'undefined' ? ConfigurationTarget.WORKSPACE : ConfigurationTarget.USER;