vsc-material-theme/extensions/helpers/configuration-change.ts
Alessio Occhipinti 0a90ac7dd2 Fix/custom settings (#237)
* chore: added accents as enum and removed accentPrevious

* chore: removed fixIconsRunning prop and added logic for replacing it

* chore: added accents as enum and removed accentPrevious

* chore: removed fixIconsRunning prop and added logic for replacing it
2018-08-16 09:11:38 +02:00

25 lines
851 B
TypeScript

import {
ConfigurationChangeEvent
} from 'vscode';
import {isMaterialThemeIcons, isMaterialTheme} from './settings';
import {getCurrentThemeIconsID, getCurrentThemeID} from './vscode';
import handleAutoapply from './handle-autoapply';
const onIconsChanged = () => {
const currentIconsTheme = getCurrentThemeIconsID();
return handleAutoapply(isMaterialThemeIcons(currentIconsTheme));
};
const onThemeChanged = () => {
const currentTheme = getCurrentThemeID();
return handleAutoapply(isMaterialTheme(currentTheme));
};
export const onChangeConfiguration = (event: ConfigurationChangeEvent) => {
const isColorTheme = event.affectsConfiguration('workbench.colorTheme');
const isIconTheme = event.affectsConfiguration('workbench.iconTheme');
return isIconTheme ? onIconsChanged() :
isColorTheme ? onThemeChanged() : null;
};