material-icon-theme 4.23.1 → 4.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/.eslintrc.json +51 -51
  2. package/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +7 -0
  3. package/.github/workflows/build.yml +45 -45
  4. package/.github/workflows/color-check.yml +22 -22
  5. package/.github/workflows/release.yml +73 -73
  6. package/.vscodeignore +21 -21
  7. package/CHANGELOG.md +1325 -1292
  8. package/CONTRIBUTING.md +199 -29
  9. package/README.md +198 -199
  10. package/icons/bitbucket.svg +13 -1
  11. package/icons/bun.svg +2 -0
  12. package/icons/bun_light.svg +2 -0
  13. package/icons/craco.svg +45 -45
  14. package/icons/folder-changesets-open.svg +5 -5
  15. package/icons/folder-changesets.svg +2 -2
  16. package/icons/folder-decorators-open.svg +2 -2
  17. package/icons/folder-decorators.svg +5 -5
  18. package/icons/folder-gamemaker-open.svg +2 -0
  19. package/icons/folder-gamemaker.svg +2 -0
  20. package/icons/folder-supabase-open.svg +5 -5
  21. package/icons/folder-supabase.svg +2 -2
  22. package/icons/gamemaker.svg +4 -0
  23. package/icons/objective-c.svg +1 -0
  24. package/icons/objective-cpp.svg +1 -0
  25. package/icons/pascal.svg +6 -1
  26. package/icons/sonarcloud.svg +4 -4
  27. package/icons/stylable.svg +10 -10
  28. package/icons/supabase.svg +4 -4
  29. package/icons/tldraw.svg +4 -0
  30. package/icons/tldraw_light.svg +4 -0
  31. package/icons/vitest.svg +6 -6
  32. package/images/contributors.png +0 -0
  33. package/images/fileIcons.png +0 -0
  34. package/images/folderIcons.png +0 -0
  35. package/images/how-tos/folder-icon-parts.png +0 -0
  36. package/images/how-tos/pick-folder-colors.png +0 -0
  37. package/images/how-tos/pick-folder-colors.svg +301 -0
  38. package/images/how-tos/svg-folder-icon-with-correct-colors.png +0 -0
  39. package/images/how-tos/svg-folder-icon-with-wrong-colors.png +0 -0
  40. package/images/how-tos/svg-with-light-color.png +0 -0
  41. package/images/how-tos/svg-with-spacing.png +0 -0
  42. package/images/how-tos/svg-with-too-dark-color.png +0 -0
  43. package/images/how-tos/svg-with-wrong-color.png +0 -0
  44. package/images/how-tos/svg-without-spacing.png +0 -0
  45. package/package.json +252 -252
  46. package/package.nls.de.json +32 -32
  47. package/package.nls.es.json +29 -29
  48. package/package.nls.fr.json +29 -29
  49. package/package.nls.ja.json +32 -32
  50. package/package.nls.json +32 -32
  51. package/package.nls.nl.json +32 -32
  52. package/package.nls.pl.json +32 -32
  53. package/package.nls.pt-BR.json +29 -29
  54. package/package.nls.pt-PT.json +29 -29
  55. package/package.nls.ru.json +29 -29
  56. package/package.nls.zh-CN.json +29 -29
  57. package/package.nls.zh-TW.json +29 -29
  58. package/src/commands/activate.ts +28 -28
  59. package/src/commands/explorerArrows.ts +55 -55
  60. package/src/commands/folderColor.ts +96 -96
  61. package/src/commands/folders.ts +55 -55
  62. package/src/commands/grayscale.ts +55 -55
  63. package/src/commands/iconPacks.ts +64 -64
  64. package/src/commands/index.ts +30 -30
  65. package/src/commands/opacity.ts +46 -46
  66. package/src/commands/saturation.ts +46 -46
  67. package/src/extension.ts +37 -37
  68. package/src/helpers/customIcons.ts +8 -8
  69. package/src/helpers/index.ts +88 -88
  70. package/src/i18n/index.ts +78 -78
  71. package/src/i18n/lang-de.ts +43 -43
  72. package/src/i18n/lang-en.ts +43 -43
  73. package/src/i18n/lang-es.ts +43 -43
  74. package/src/i18n/lang-fr.ts +43 -43
  75. package/src/i18n/lang-ja.ts +43 -43
  76. package/src/i18n/lang-nl.ts +43 -43
  77. package/src/i18n/lang-pl.ts +43 -43
  78. package/src/i18n/lang-pt-br.ts +43 -43
  79. package/src/i18n/lang-pt-pt.ts +43 -43
  80. package/src/i18n/lang-ru.ts +43 -43
  81. package/src/i18n/lang-uk.ts +43 -43
  82. package/src/i18n/lang-zh-cn.ts +43 -43
  83. package/src/i18n/lang-zh-tw.ts +43 -43
  84. package/src/icons/fileIcons.ts +2240 -2197
  85. package/src/icons/folderIcons.ts +823 -806
  86. package/src/icons/generator/folderGenerator.ts +340 -340
  87. package/src/icons/generator/iconOpacity.ts +111 -111
  88. package/src/icons/generator/iconSaturation.ts +140 -140
  89. package/src/icons/generator/jsonGenerator.ts +191 -191
  90. package/src/icons/languageIcons.ts +144 -141
  91. package/src/models/i18n/translation.ts +41 -41
  92. package/src/models/iconConfiguration.ts +37 -37
  93. package/src/models/icons/iconJsonOptions.ts +21 -21
  94. package/src/models/index.ts +3 -3
  95. package/src/scripts/contributors/index.ts +138 -138
  96. package/src/scripts/helpers/screenshots.ts +32 -32
  97. package/src/scripts/icons/checks/checkIconAvailability.ts +215 -215
  98. package/src/scripts/icons/checks/checkIconConflicts.ts +152 -152
  99. package/src/scripts/icons/checks/checkIconUsage.ts +137 -137
  100. package/src/scripts/icons/checks/index.ts +7 -7
  101. package/src/scripts/preview/index.ts +40 -40
  102. package/src/scripts/preview/preview.ts +163 -163
  103. package/src/test/runTest.ts +26 -26
  104. package/src/test/spec/i18n/i18n.spec.ts +54 -54
  105. package/src/test/spec/icons/fileIcons.spec.ts +250 -250
  106. package/src/test/spec/icons/folderIcons.spec.ts +418 -418
  107. package/src/test/spec/icons/languageIcons.spec.ts +184 -184
  108. package/images/bloop.png +0 -0
@@ -1,29 +1,29 @@
1
- {
2
- "command.activateIcons": "Material Icons: 激活Material Icons文件圖標主題",
3
- "command.toggleIconPacks": "Material Icons: 選擇一個圖標包",
4
- "command.changeFolderTheme": "Material Icons: 切換文件夾圖標",
5
- "command.changeFolderColor": "Material Icons: 更改文件夾顏色",
6
- "command.restoreDefaultConfig": "Material Icons: 恢復默認設置",
7
- "command.toggleExplorerArrows": "Material Icons: 隱藏文件夾箭頭",
8
- "command.changeOpacity": "Material Icons: 改變不透明度",
9
- "configuration.title": "Material Icons",
10
- "configuration.files.associations": "設置自定義文件圖標關聯。",
11
- "configuration.folders.associations": "設置自定義文件夾圖標關聯。",
12
- "configuration.languages.associations": "定義自定義語言映射的圖標。",
13
- "configuration.activeIconPack": "選擇一個圖標包。",
14
- "configuration.activeIconPack.angular": "Angular的圖標。",
15
- "configuration.activeIconPack.angular_ngrx": "Angular和ngrx的圖標。",
16
- "configuration.activeIconPack.react": "React的圖標。",
17
- "configuration.activeIconPack.react_redux": "React和Redux的圖標。",
18
- "configuration.activeIconPack.vue": "Vue的圖標。",
19
- "configuration.activeIconPack.vue_vuex": "Vue和Vuex的圖標。",
20
- "configuration.activeIconPack.nest": "NestJS的圖標。",
21
- "configuration.activeIconPack.none": "沒有啟用圖標包。",
22
- "configuration.folders.theme": "設置文件夾圖標的類型。",
23
- "configuration.folders.theme.specific": "選擇特定文件夾圖標。",
24
- "configuration.folders.theme.classic": "選擇經典文件夾圖標。",
25
- "configuration.folders.theme.none": "沒有文件夾圖標。",
26
- "configuration.folders.color": "更改文件夾圖標的顏色。",
27
- "configuration.hidesExplorerArrows": "隱藏該文件夾旁邊的箭頭。",
28
- "configuration.opacity": "更改圖標的透明度。"
29
- }
1
+ {
2
+ "command.activateIcons": "Material Icons: 激活Material Icons文件圖標主題",
3
+ "command.toggleIconPacks": "Material Icons: 選擇一個圖標包",
4
+ "command.changeFolderTheme": "Material Icons: 切換文件夾圖標",
5
+ "command.changeFolderColor": "Material Icons: 更改文件夾顏色",
6
+ "command.restoreDefaultConfig": "Material Icons: 恢復默認設置",
7
+ "command.toggleExplorerArrows": "Material Icons: 隱藏文件夾箭頭",
8
+ "command.changeOpacity": "Material Icons: 改變不透明度",
9
+ "configuration.title": "Material Icons",
10
+ "configuration.files.associations": "設置自定義文件圖標關聯。",
11
+ "configuration.folders.associations": "設置自定義文件夾圖標關聯。",
12
+ "configuration.languages.associations": "定義自定義語言映射的圖標。",
13
+ "configuration.activeIconPack": "選擇一個圖標包。",
14
+ "configuration.activeIconPack.angular": "Angular的圖標。",
15
+ "configuration.activeIconPack.angular_ngrx": "Angular和ngrx的圖標。",
16
+ "configuration.activeIconPack.react": "React的圖標。",
17
+ "configuration.activeIconPack.react_redux": "React和Redux的圖標。",
18
+ "configuration.activeIconPack.vue": "Vue的圖標。",
19
+ "configuration.activeIconPack.vue_vuex": "Vue和Vuex的圖標。",
20
+ "configuration.activeIconPack.nest": "NestJS的圖標。",
21
+ "configuration.activeIconPack.none": "沒有啟用圖標包。",
22
+ "configuration.folders.theme": "設置文件夾圖標的類型。",
23
+ "configuration.folders.theme.specific": "選擇特定文件夾圖標。",
24
+ "configuration.folders.theme.classic": "選擇經典文件夾圖標。",
25
+ "configuration.folders.theme.none": "沒有文件夾圖標。",
26
+ "configuration.folders.color": "更改文件夾圖標的顏色。",
27
+ "configuration.hidesExplorerArrows": "隱藏該文件夾旁邊的箭頭。",
28
+ "configuration.opacity": "更改圖標的透明度。"
29
+ }
@@ -1,28 +1,28 @@
1
- import { window as codeWindow } from 'vscode';
2
- import { getConfig } from '../helpers';
3
- import { translate } from '../i18n';
4
-
5
- /** Activate the icon theme by changing the settings for the iconTheme. */
6
- export const activateIcons = () => {
7
- return setIconTheme();
8
- };
9
-
10
- /** Set the icon theme in the config. */
11
- const setIconTheme = async () => {
12
- // global user config
13
- try {
14
- await getConfig().update(
15
- 'workbench.iconTheme',
16
- 'material-icon-theme',
17
- true
18
- );
19
-
20
- // local workspace config
21
- if (getConfig().inspect('workbench.iconTheme')?.workspaceValue) {
22
- getConfig().update('workbench.iconTheme', 'material-icon-theme');
23
- }
24
- codeWindow.showInformationMessage(translate('activated'));
25
- } catch (error) {
26
- console.error(error);
27
- }
28
- };
1
+ import { window as codeWindow } from 'vscode';
2
+ import { getConfig } from '../helpers';
3
+ import { translate } from '../i18n';
4
+
5
+ /** Activate the icon theme by changing the settings for the iconTheme. */
6
+ export const activateIcons = () => {
7
+ return setIconTheme();
8
+ };
9
+
10
+ /** Set the icon theme in the config. */
11
+ const setIconTheme = async () => {
12
+ // global user config
13
+ try {
14
+ await getConfig().update(
15
+ 'workbench.iconTheme',
16
+ 'material-icon-theme',
17
+ true
18
+ );
19
+
20
+ // local workspace config
21
+ if (getConfig().inspect('workbench.iconTheme')?.workspaceValue) {
22
+ getConfig().update('workbench.iconTheme', 'material-icon-theme');
23
+ }
24
+ codeWindow.showInformationMessage(translate('activated'));
25
+ } catch (error) {
26
+ console.error(error);
27
+ }
28
+ };
@@ -1,55 +1,55 @@
1
- import { QuickPickItem, window as codeWindow } from 'vscode';
2
- import { getMaterialIconsJSON, setThemeConfig } from '../helpers';
3
- import { translate } from '../i18n';
4
-
5
- /** Command to toggle the explorer arrows. */
6
- export const toggleExplorerArrows = async () => {
7
- try {
8
- const status = checkArrowStatus();
9
- const response = await showQuickPickItems(status);
10
- return handleQuickPickActions(response);
11
- } catch (error) {
12
- console.error(error);
13
- }
14
- };
15
-
16
- /** Show QuickPick items to select preferred configuration for the explorer arrows. */
17
- const showQuickPickItems = (
18
- status: boolean
19
- ): Thenable<QuickPickItem | undefined> => {
20
- const on: QuickPickItem = {
21
- description: translate('toggleSwitch.on'),
22
- detail: translate('explorerArrows.enable'),
23
- label: !status ? '\u2714' : '\u25FB',
24
- };
25
- const off: QuickPickItem = {
26
- description: translate('toggleSwitch.off'),
27
- detail: translate('explorerArrows.disable'),
28
- label: status ? '\u2714' : '\u25FB',
29
- };
30
- return codeWindow.showQuickPick([on, off], {
31
- placeHolder: translate('explorerArrows.toggle'),
32
- ignoreFocusOut: false,
33
- matchOnDescription: true,
34
- });
35
- };
36
-
37
- /** Handle the actions from the QuickPick. */
38
- const handleQuickPickActions = (value: QuickPickItem | undefined) => {
39
- if (!value?.description) return;
40
- switch (value.description) {
41
- case translate('toggleSwitch.on'): {
42
- return setThemeConfig('hidesExplorerArrows', false, true);
43
- }
44
- case translate('toggleSwitch.off'): {
45
- return setThemeConfig('hidesExplorerArrows', true, true);
46
- }
47
- default:
48
- return;
49
- }
50
- };
51
-
52
- /** Check if arrows are enabled. */
53
- export const checkArrowStatus = (): boolean => {
54
- return !!getMaterialIconsJSON()?.hidesExplorerArrows;
55
- };
1
+ import { QuickPickItem, window as codeWindow } from 'vscode';
2
+ import { getMaterialIconsJSON, setThemeConfig } from '../helpers';
3
+ import { translate } from '../i18n';
4
+
5
+ /** Command to toggle the explorer arrows. */
6
+ export const toggleExplorerArrows = async () => {
7
+ try {
8
+ const status = checkArrowStatus();
9
+ const response = await showQuickPickItems(status);
10
+ return handleQuickPickActions(response);
11
+ } catch (error) {
12
+ console.error(error);
13
+ }
14
+ };
15
+
16
+ /** Show QuickPick items to select preferred configuration for the explorer arrows. */
17
+ const showQuickPickItems = (
18
+ status: boolean
19
+ ): Thenable<QuickPickItem | undefined> => {
20
+ const on: QuickPickItem = {
21
+ description: translate('toggleSwitch.on'),
22
+ detail: translate('explorerArrows.enable'),
23
+ label: !status ? '\u2714' : '\u25FB',
24
+ };
25
+ const off: QuickPickItem = {
26
+ description: translate('toggleSwitch.off'),
27
+ detail: translate('explorerArrows.disable'),
28
+ label: status ? '\u2714' : '\u25FB',
29
+ };
30
+ return codeWindow.showQuickPick([on, off], {
31
+ placeHolder: translate('explorerArrows.toggle'),
32
+ ignoreFocusOut: false,
33
+ matchOnDescription: true,
34
+ });
35
+ };
36
+
37
+ /** Handle the actions from the QuickPick. */
38
+ const handleQuickPickActions = (value: QuickPickItem | undefined) => {
39
+ if (!value?.description) return;
40
+ switch (value.description) {
41
+ case translate('toggleSwitch.on'): {
42
+ return setThemeConfig('hidesExplorerArrows', false, true);
43
+ }
44
+ case translate('toggleSwitch.off'): {
45
+ return setThemeConfig('hidesExplorerArrows', true, true);
46
+ }
47
+ default:
48
+ return;
49
+ }
50
+ };
51
+
52
+ /** Check if arrows are enabled. */
53
+ export const checkArrowStatus = (): boolean => {
54
+ return !!getMaterialIconsJSON()?.hidesExplorerArrows;
55
+ };
@@ -1,96 +1,96 @@
1
- import { QuickPickItem, window as codeWindow } from 'vscode';
2
- import { getMaterialIconsJSON, setThemeConfig } from '../helpers';
3
- import { translate } from '../i18n';
4
- import { getDefaultIconOptions, validateHEXColorCode } from '../icons';
5
-
6
- interface FolderColor {
7
- label: string;
8
- hex: string;
9
- }
10
-
11
- const iconPalette: FolderColor[] = [
12
- { label: 'Grey (Default)', hex: '#90a4ae' },
13
- { label: 'Blue', hex: '#42a5f5' },
14
- { label: 'Green', hex: '#7CB342' },
15
- { label: 'Teal', hex: '#26A69A' },
16
- { label: 'Red', hex: '#EF5350' },
17
- { label: 'Orange', hex: '#FF7043' },
18
- { label: 'Yellow', hex: '#FDD835' },
19
- { label: 'Custom Color', hex: 'Custom HEX Code' },
20
- ];
21
-
22
- /** Command to toggle the folder icons. */
23
- export const changeFolderColor = async () => {
24
- try {
25
- const status = checkFolderColorStatus();
26
- const response = await showQuickPickItems(status);
27
- if (response) {
28
- handleQuickPickActions(response);
29
- }
30
- } catch (error) {
31
- console.error(error);
32
- }
33
- };
34
-
35
- /** Show QuickPick items to select preferred color for the folder icons. */
36
- const showQuickPickItems = (currentColor: string) => {
37
- const options = iconPalette.map(
38
- (color): QuickPickItem => ({
39
- description: color.label,
40
- label: isColorActive(color, currentColor) ? '\u2714' : '\u25FB',
41
- })
42
- );
43
-
44
- return codeWindow.showQuickPick(options, {
45
- placeHolder: translate('folders.color'),
46
- ignoreFocusOut: false,
47
- matchOnDescription: true,
48
- });
49
- };
50
-
51
- /** Handle the actions from the QuickPick. */
52
- const handleQuickPickActions = async (value: QuickPickItem) => {
53
- if (!value || !value.description) return;
54
- if (value.description === 'Custom Color') {
55
- const value = await codeWindow.showInputBox({
56
- placeHolder: translate('folders.hexCode'),
57
- ignoreFocusOut: true,
58
- validateInput: validateColorInput,
59
- });
60
- if (value) {
61
- setColorConfig(value);
62
- }
63
- } else {
64
- const hexCode = iconPalette.find((c) => c.label === value.description)?.hex;
65
- if (hexCode) {
66
- setColorConfig(hexCode);
67
- }
68
- }
69
- };
70
-
71
- const validateColorInput = (colorInput: string) => {
72
- if (!validateHEXColorCode(colorInput)) {
73
- return translate('folders.wrongHexCode');
74
- }
75
- return undefined;
76
- };
77
-
78
- /** Check status of the folder color */
79
- export const checkFolderColorStatus = (): string => {
80
- const defaultOptions = getDefaultIconOptions();
81
- const config = getMaterialIconsJSON();
82
- return config?.options?.folders?.color ?? defaultOptions.folders.color!;
83
- };
84
-
85
- const setColorConfig = (value: string) => {
86
- setThemeConfig('folders.color', value.toLowerCase(), true);
87
- };
88
-
89
- const isColorActive = (color: FolderColor, currentColor: string): boolean => {
90
- if (color.label === 'Custom Color') {
91
- return !iconPalette.some(
92
- (c) => c.hex.toLowerCase() === currentColor.toLowerCase()
93
- );
94
- }
95
- return color.hex.toLowerCase() === currentColor.toLowerCase();
96
- };
1
+ import { QuickPickItem, window as codeWindow } from 'vscode';
2
+ import { getMaterialIconsJSON, setThemeConfig } from '../helpers';
3
+ import { translate } from '../i18n';
4
+ import { getDefaultIconOptions, validateHEXColorCode } from '../icons';
5
+
6
+ interface FolderColor {
7
+ label: string;
8
+ hex: string;
9
+ }
10
+
11
+ const iconPalette: FolderColor[] = [
12
+ { label: 'Grey (Default)', hex: '#90a4ae' },
13
+ { label: 'Blue', hex: '#42a5f5' },
14
+ { label: 'Green', hex: '#7CB342' },
15
+ { label: 'Teal', hex: '#26A69A' },
16
+ { label: 'Red', hex: '#EF5350' },
17
+ { label: 'Orange', hex: '#FF7043' },
18
+ { label: 'Yellow', hex: '#FDD835' },
19
+ { label: 'Custom Color', hex: 'Custom HEX Code' },
20
+ ];
21
+
22
+ /** Command to toggle the folder icons. */
23
+ export const changeFolderColor = async () => {
24
+ try {
25
+ const status = checkFolderColorStatus();
26
+ const response = await showQuickPickItems(status);
27
+ if (response) {
28
+ handleQuickPickActions(response);
29
+ }
30
+ } catch (error) {
31
+ console.error(error);
32
+ }
33
+ };
34
+
35
+ /** Show QuickPick items to select preferred color for the folder icons. */
36
+ const showQuickPickItems = (currentColor: string) => {
37
+ const options = iconPalette.map(
38
+ (color): QuickPickItem => ({
39
+ description: color.label,
40
+ label: isColorActive(color, currentColor) ? '\u2714' : '\u25FB',
41
+ })
42
+ );
43
+
44
+ return codeWindow.showQuickPick(options, {
45
+ placeHolder: translate('folders.color'),
46
+ ignoreFocusOut: false,
47
+ matchOnDescription: true,
48
+ });
49
+ };
50
+
51
+ /** Handle the actions from the QuickPick. */
52
+ const handleQuickPickActions = async (value: QuickPickItem) => {
53
+ if (!value || !value.description) return;
54
+ if (value.description === 'Custom Color') {
55
+ const value = await codeWindow.showInputBox({
56
+ placeHolder: translate('folders.hexCode'),
57
+ ignoreFocusOut: true,
58
+ validateInput: validateColorInput,
59
+ });
60
+ if (value) {
61
+ setColorConfig(value);
62
+ }
63
+ } else {
64
+ const hexCode = iconPalette.find((c) => c.label === value.description)?.hex;
65
+ if (hexCode) {
66
+ setColorConfig(hexCode);
67
+ }
68
+ }
69
+ };
70
+
71
+ const validateColorInput = (colorInput: string) => {
72
+ if (!validateHEXColorCode(colorInput)) {
73
+ return translate('folders.wrongHexCode');
74
+ }
75
+ return undefined;
76
+ };
77
+
78
+ /** Check status of the folder color */
79
+ export const checkFolderColorStatus = (): string => {
80
+ const defaultOptions = getDefaultIconOptions();
81
+ const config = getMaterialIconsJSON();
82
+ return config?.options?.folders?.color ?? defaultOptions.folders.color!;
83
+ };
84
+
85
+ const setColorConfig = (value: string) => {
86
+ setThemeConfig('folders.color', value.toLowerCase(), true);
87
+ };
88
+
89
+ const isColorActive = (color: FolderColor, currentColor: string): boolean => {
90
+ if (color.label === 'Custom Color') {
91
+ return !iconPalette.some(
92
+ (c) => c.hex.toLowerCase() === currentColor.toLowerCase()
93
+ );
94
+ }
95
+ return color.hex.toLowerCase() === currentColor.toLowerCase();
96
+ };
@@ -1,55 +1,55 @@
1
- import { QuickPickItem, window as codeWindow } from 'vscode';
2
- import {
3
- capitalizeFirstLetter,
4
- getMaterialIconsJSON,
5
- setThemeConfig,
6
- } from '../helpers';
7
- import { translate } from '../i18n';
8
- import { folderIcons } from '../icons';
9
-
10
- /** Command to toggle the folder icons. */
11
- export const changeFolderTheme = async () => {
12
- try {
13
- const status = getFolderIconTheme();
14
- const response = await showQuickPickItems(status);
15
- if (response) {
16
- handleQuickPickActions(response);
17
- }
18
- } catch (error) {
19
- console.error(error);
20
- }
21
- };
22
-
23
- /** Show QuickPick items to select preferred configuration for the folder icons. */
24
- const showQuickPickItems = (activeTheme: string) => {
25
- const options = folderIcons.map(
26
- (theme): QuickPickItem => ({
27
- description: capitalizeFirstLetter(theme.name),
28
- detail:
29
- theme.name === 'none'
30
- ? translate('folders.disabled')
31
- : translate(
32
- 'folders.theme.description',
33
- capitalizeFirstLetter(theme.name)
34
- ),
35
- label: theme.name === activeTheme ? '\u2714' : '\u25FB',
36
- })
37
- );
38
-
39
- return codeWindow.showQuickPick(options, {
40
- placeHolder: translate('folders.toggleIcons'),
41
- ignoreFocusOut: false,
42
- matchOnDescription: true,
43
- });
44
- };
45
-
46
- /** Handle the actions from the QuickPick. */
47
- const handleQuickPickActions = (value: QuickPickItem) => {
48
- if (!value || !value.description) return;
49
- return setThemeConfig('folders.theme', value.description.toLowerCase(), true);
50
- };
51
-
52
- /** Get the current folder theme. */
53
- export const getFolderIconTheme = (): string => {
54
- return getMaterialIconsJSON()?.options?.folders?.theme ?? '';
55
- };
1
+ import { QuickPickItem, window as codeWindow } from 'vscode';
2
+ import {
3
+ capitalizeFirstLetter,
4
+ getMaterialIconsJSON,
5
+ setThemeConfig,
6
+ } from '../helpers';
7
+ import { translate } from '../i18n';
8
+ import { folderIcons } from '../icons';
9
+
10
+ /** Command to toggle the folder icons. */
11
+ export const changeFolderTheme = async () => {
12
+ try {
13
+ const status = getFolderIconTheme();
14
+ const response = await showQuickPickItems(status);
15
+ if (response) {
16
+ handleQuickPickActions(response);
17
+ }
18
+ } catch (error) {
19
+ console.error(error);
20
+ }
21
+ };
22
+
23
+ /** Show QuickPick items to select preferred configuration for the folder icons. */
24
+ const showQuickPickItems = (activeTheme: string) => {
25
+ const options = folderIcons.map(
26
+ (theme): QuickPickItem => ({
27
+ description: capitalizeFirstLetter(theme.name),
28
+ detail:
29
+ theme.name === 'none'
30
+ ? translate('folders.disabled')
31
+ : translate(
32
+ 'folders.theme.description',
33
+ capitalizeFirstLetter(theme.name)
34
+ ),
35
+ label: theme.name === activeTheme ? '\u2714' : '\u25FB',
36
+ })
37
+ );
38
+
39
+ return codeWindow.showQuickPick(options, {
40
+ placeHolder: translate('folders.toggleIcons'),
41
+ ignoreFocusOut: false,
42
+ matchOnDescription: true,
43
+ });
44
+ };
45
+
46
+ /** Handle the actions from the QuickPick. */
47
+ const handleQuickPickActions = (value: QuickPickItem) => {
48
+ if (!value || !value.description) return;
49
+ return setThemeConfig('folders.theme', value.description.toLowerCase(), true);
50
+ };
51
+
52
+ /** Get the current folder theme. */
53
+ export const getFolderIconTheme = (): string => {
54
+ return getMaterialIconsJSON()?.options?.folders?.theme ?? '';
55
+ };
@@ -1,55 +1,55 @@
1
- import { QuickPickItem, window as codeWindow } from 'vscode';
2
- import { getMaterialIconsJSON, setThemeConfig } from '../helpers';
3
- import { translate } from '../i18n';
4
-
5
- /** Command to toggle grayscale. */
6
- export const toggleGrayscale = async () => {
7
- try {
8
- const status = checkGrayscaleStatus();
9
- const response = await showQuickPickItems(status);
10
- if (response) {
11
- handleQuickPickActions(response);
12
- }
13
- } catch (error) {
14
- console.error(error);
15
- }
16
- };
17
-
18
- /** Show QuickPick items to select preferred configuration for grayscale icons. */
19
- const showQuickPickItems = (status: boolean) => {
20
- const on: QuickPickItem = {
21
- description: translate('toggleSwitch.on'),
22
- detail: translate('grayscale.enable'),
23
- label: status ? '\u2714' : '\u25FB',
24
- };
25
- const off: QuickPickItem = {
26
- description: translate('toggleSwitch.off'),
27
- detail: translate('grayscale.disable'),
28
- label: !status ? '\u2714' : '\u25FB',
29
- };
30
- return codeWindow.showQuickPick([on, off], {
31
- placeHolder: translate('grayscale.toggle'),
32
- ignoreFocusOut: false,
33
- matchOnDescription: true,
34
- });
35
- };
36
-
37
- /** Handle the actions from the QuickPick. */
38
- const handleQuickPickActions = (value: QuickPickItem) => {
39
- if (!value || !value.description) return;
40
- switch (value.description) {
41
- case translate('toggleSwitch.on'): {
42
- return setThemeConfig('saturation', 0, true);
43
- }
44
- case translate('toggleSwitch.off'): {
45
- return setThemeConfig('saturation', 1, true);
46
- }
47
- default:
48
- return;
49
- }
50
- };
51
-
52
- /** Is grayscale icons enabled? */
53
- export const checkGrayscaleStatus = (): boolean => {
54
- return getMaterialIconsJSON()?.options?.saturation === 0;
55
- };
1
+ import { QuickPickItem, window as codeWindow } from 'vscode';
2
+ import { getMaterialIconsJSON, setThemeConfig } from '../helpers';
3
+ import { translate } from '../i18n';
4
+
5
+ /** Command to toggle grayscale. */
6
+ export const toggleGrayscale = async () => {
7
+ try {
8
+ const status = checkGrayscaleStatus();
9
+ const response = await showQuickPickItems(status);
10
+ if (response) {
11
+ handleQuickPickActions(response);
12
+ }
13
+ } catch (error) {
14
+ console.error(error);
15
+ }
16
+ };
17
+
18
+ /** Show QuickPick items to select preferred configuration for grayscale icons. */
19
+ const showQuickPickItems = (status: boolean) => {
20
+ const on: QuickPickItem = {
21
+ description: translate('toggleSwitch.on'),
22
+ detail: translate('grayscale.enable'),
23
+ label: status ? '\u2714' : '\u25FB',
24
+ };
25
+ const off: QuickPickItem = {
26
+ description: translate('toggleSwitch.off'),
27
+ detail: translate('grayscale.disable'),
28
+ label: !status ? '\u2714' : '\u25FB',
29
+ };
30
+ return codeWindow.showQuickPick([on, off], {
31
+ placeHolder: translate('grayscale.toggle'),
32
+ ignoreFocusOut: false,
33
+ matchOnDescription: true,
34
+ });
35
+ };
36
+
37
+ /** Handle the actions from the QuickPick. */
38
+ const handleQuickPickActions = (value: QuickPickItem) => {
39
+ if (!value || !value.description) return;
40
+ switch (value.description) {
41
+ case translate('toggleSwitch.on'): {
42
+ return setThemeConfig('saturation', 0, true);
43
+ }
44
+ case translate('toggleSwitch.off'): {
45
+ return setThemeConfig('saturation', 1, true);
46
+ }
47
+ default:
48
+ return;
49
+ }
50
+ };
51
+
52
+ /** Is grayscale icons enabled? */
53
+ export const checkGrayscaleStatus = (): boolean => {
54
+ return getMaterialIconsJSON()?.options?.saturation === 0;
55
+ };