Skip to content

Commit 233c9b8

Browse files
committed
microsoft#68408 get the current theme from setting
1 parent dbce60b commit 233c9b8

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ import { clipboard } from 'electron';
5555
import { IPartService } from 'vs/workbench/services/part/common/partService';
5656
import { alert } from 'vs/base/browser/ui/aria/aria';
5757
import { coalesce } from 'vs/base/common/arrays';
58-
import { IWorkbenchThemeService, COLOR_THEME_SETTING } from 'vs/workbench/services/themes/common/workbenchThemeService';
58+
import { IWorkbenchThemeService, COLOR_THEME_SETTING, ICON_THEME_SETTING } from 'vs/workbench/services/themes/common/workbenchThemeService';
5959

6060
function toExtensionDescription(local: ILocalExtension): IExtensionDescription {
6161
return {
@@ -1141,7 +1141,8 @@ export class SetColorThemeAction extends ExtensionAction {
11411141
return;
11421142
}
11431143
let colorThemes = await this.workbenchThemeService.getColorThemes(new ExtensionIdentifier(this.extension.identifier.id));
1144-
const currentTheme = this.workbenchThemeService.getColorTheme();
1144+
const allThemes = await this.workbenchThemeService.getColorThemes();
1145+
const currentTheme = allThemes.filter(t => t.settingsId === this.configurationService.getValue(COLOR_THEME_SETTING))[0];
11451146
showCurrentTheme = showCurrentTheme || colorThemes.some(t => t.id === currentTheme.id);
11461147
if (showCurrentTheme) {
11471148
colorThemes = colorThemes.filter(t => t.id !== currentTheme.id);
@@ -1207,7 +1208,8 @@ export class SetFileIconThemeAction extends ExtensionAction {
12071208
return;
12081209
}
12091210
let fileIconThemes = await this.workbenchThemeService.getFileIconThemes(new ExtensionIdentifier(this.extension.identifier.id));
1210-
const currentTheme = this.workbenchThemeService.getFileIconTheme();
1211+
const allThemes = await this.workbenchThemeService.getFileIconThemes();
1212+
const currentTheme = allThemes.filter(t => t.settingsId === this.configurationService.getValue(ICON_THEME_SETTING))[0];
12111213
showCurrentTheme = showCurrentTheme || fileIconThemes.some(t => t.id === currentTheme.id);
12121214
if (showCurrentTheme) {
12131215
fileIconThemes = fileIconThemes.filter(t => t.id !== currentTheme.id);
@@ -1226,7 +1228,7 @@ export class SetFileIconThemeAction extends ExtensionAction {
12261228
placeHolder: localize('select file icon theme', "Select File Icon Theme"),
12271229
onDidFocus: item => delayer.trigger(() => this.workbenchThemeService.setFileIconTheme(item.id, undefined))
12281230
});
1229-
let confValue = this.configurationService.inspect(COLOR_THEME_SETTING);
1231+
let confValue = this.configurationService.inspect(ICON_THEME_SETTING);
12301232
const target = typeof confValue.workspace !== 'undefined' ? ConfigurationTarget.WORKSPACE : ConfigurationTarget.USER;
12311233
return this.workbenchThemeService.setFileIconTheme(pickedTheme ? pickedTheme.id : currentTheme.id, target);
12321234
}

0 commit comments

Comments
 (0)