Skip to content

Commit 6e142bc

Browse files
committed
Fix theme picker on install
1 parent 7153ea4 commit 6e142bc

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

src/vs/workbench/contrib/extensions/electron-browser/extensionsActions.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,12 @@ export class InstallAction extends ExtensionAction {
190190
if (SetColorThemeAction.getColorThemes(colorThemes, this.extension).length) {
191191
const action = this.instantiationService.createInstance(SetColorThemeAction, colorThemes);
192192
action.extension = extension;
193-
return action.run(true);
193+
return action.run({ showCurrentTheme: true, ignoreFocusLost: true });
194194
}
195195
if (SetFileIconThemeAction.getFileIconThemes(fileIconThemes, this.extension).length) {
196196
const action = this.instantiationService.createInstance(SetFileIconThemeAction, fileIconThemes);
197197
action.extension = extension;
198-
return action.run(true);
198+
return action.run({ showCurrentTheme: true, ignoreFocusLost: true });
199199
}
200200
}
201201
}
@@ -1158,7 +1158,7 @@ export class SetColorThemeAction extends ExtensionAction {
11581158
this.class = this.enabled ? SetColorThemeAction.EnabledClass : SetColorThemeAction.DisabledClass;
11591159
}
11601160

1161-
async run(showCurrentTheme: boolean): Promise<any> {
1161+
async run({ showCurrentTheme, ignoreFocusLost }: { showCurrentTheme: boolean, ignoreFocusLost: boolean } = { showCurrentTheme: false, ignoreFocusLost: false }): Promise<any> {
11621162
this.update();
11631163
if (!this.enabled) {
11641164
return;
@@ -1181,7 +1181,8 @@ export class SetColorThemeAction extends ExtensionAction {
11811181
picks,
11821182
{
11831183
placeHolder: localize('select color theme', "Select Color Theme"),
1184-
onDidFocus: item => delayer.trigger(() => this.workbenchThemeService.setColorTheme(item.id, undefined))
1184+
onDidFocus: item => delayer.trigger(() => this.workbenchThemeService.setColorTheme(item.id, undefined)),
1185+
ignoreFocusLost
11851186
});
11861187
let confValue = this.configurationService.inspect(COLOR_THEME_SETTING);
11871188
const target = typeof confValue.workspace !== 'undefined' ? ConfigurationTarget.WORKSPACE : ConfigurationTarget.USER;
@@ -1229,7 +1230,7 @@ export class SetFileIconThemeAction extends ExtensionAction {
12291230
this.class = this.enabled ? SetFileIconThemeAction.EnabledClass : SetFileIconThemeAction.DisabledClass;
12301231
}
12311232

1232-
async run(showCurrentTheme: boolean): Promise<any> {
1233+
async run({ showCurrentTheme, ignoreFocusLost }: { showCurrentTheme: boolean, ignoreFocusLost: boolean } = { showCurrentTheme: false, ignoreFocusLost: false }): Promise<any> {
12331234
await this.update();
12341235
if (!this.enabled) {
12351236
return;
@@ -1252,7 +1253,8 @@ export class SetFileIconThemeAction extends ExtensionAction {
12521253
picks,
12531254
{
12541255
placeHolder: localize('select file icon theme', "Select File Icon Theme"),
1255-
onDidFocus: item => delayer.trigger(() => this.workbenchThemeService.setFileIconTheme(item.id, undefined))
1256+
onDidFocus: item => delayer.trigger(() => this.workbenchThemeService.setFileIconTheme(item.id, undefined)),
1257+
ignoreFocusLost
12561258
});
12571259
let confValue = this.configurationService.inspect(ICON_THEME_SETTING);
12581260
const target = typeof confValue.workspace !== 'undefined' ? ConfigurationTarget.WORKSPACE : ConfigurationTarget.USER;

0 commit comments

Comments
 (0)