chore: Fixes regression over icons variants. Asks user to reload vsc for session reload.

This commit is contained in:
OctoD 2017-06-23 20:39:06 +02:00
parent a412e4edde
commit 0bbeecf35b
4 changed files with 17 additions and 3 deletions

View file

@ -35,6 +35,7 @@ export const THEME_CHANGE_LISTENER = () => {
theme.iconDefinitions._folder_dark.iconPath = defaults.icons.theme.iconDefinitions._folder_dark.iconPath.replace('.svg', `${ variantName }.svg`); theme.iconDefinitions._folder_dark.iconPath = defaults.icons.theme.iconDefinitions._folder_dark.iconPath.replace('.svg', `${ variantName }.svg`);
theme.iconDefinitions._file_folder.iconPath = defaults.icons.theme.iconDefinitions._file_folder.iconPath.replace('.svg', `${ variantName }.svg`); theme.iconDefinitions._file_folder.iconPath = defaults.icons.theme.iconDefinitions._file_folder.iconPath.replace('.svg', `${ variantName }.svg`);
theme.iconDefinitions._folder_dark_build.iconPath = defaults.icons.theme.iconDefinitions._folder_dark_build.iconPath.replace('.svg', `${ variantName }.svg`);
theme.iconDefinitions["_file_folder-build"].iconPath = defaults.icons.theme.iconDefinitions["_file_folder-build"].iconPath.replace('.svg', `${ variantName }.svg`); theme.iconDefinitions["_file_folder-build"].iconPath = defaults.icons.theme.iconDefinitions["_file_folder-build"].iconPath.replace('.svg', `${ variantName }.svg`);
fs.writeFile(themepath, JSON.stringify(theme), { encoding: CHARSET }, (error) => { fs.writeFile(themepath, JSON.stringify(theme), { encoding: CHARSET }, (error) => {
@ -42,9 +43,16 @@ export const THEME_CHANGE_LISTENER = () => {
console.trace(error); console.trace(error);
return; return;
} }
const PROMPT_MESSAGE: string = 'Material Theme requires VS Code reload in order to display icons correctly.';
const PROMPT_MESSAGE_CONFIRM: string = 'Ok, reload';
const PROMPT_MESSAGE_CANCEL: string = 'I will do it later';
if (shouldReloadWindow(themeID, themeIconsID)) { if (shouldReloadWindow(themeID, themeIconsID)) {
vscode.window.showInformationMessage('Material theme requires VS Code reload in order to look very good').then(() => { vscode.window.showInformationMessage(PROMPT_MESSAGE, PROMPT_MESSAGE_CONFIRM, PROMPT_MESSAGE_CANCEL).then((response) => {
reloadWindow(); if (response === PROMPT_MESSAGE_CONFIRM) {
reloadWindow();
}
}, (error) => { }, (error) => {
console.log(error); console.log(error);
}); });

View file

@ -26,6 +26,9 @@
"_file_folder": { "_file_folder": {
"iconPath": "../icons/folder.svg" "iconPath": "../icons/folder.svg"
}, },
"_folder_dark_build": {
"iconPath": "../icons/folder-build.svg"
},
"_file_folder-build": { "_file_folder-build": {
"iconPath": "../icons/folder-build.svg" "iconPath": "../icons/folder-build.svg"
}, },

View file

@ -21,6 +21,9 @@ export interface IDefaultsThemeIcons {
_folder_dark: { _folder_dark: {
iconPath: string; iconPath: string;
} }
_folder_dark_build: {
iconPath: string;
}
"_file_folder-build": { "_file_folder-build": {
iconPath: string; iconPath: string;
} }