Skip to content

Commit e765b1e

Browse files
authored
Use product icons instead of 'hardcoded' icons (#3737)
* Use product icons instead of 'hardcoded' icons - Add a product icon font instead of icons that are unchangable by product icon themes - Add a script using FontForge scripting API for generating product icon font for future use - Remove redundant icons that are already part of codicons * Revert accidental addition of 'languages' contribution entry
1 parent 925119f commit e765b1e

21 files changed

+448
-172
lines changed

package.json

Lines changed: 60 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,50 @@
6767
],
6868
"main": "./dist/main",
6969
"contributes": {
70+
"icons": {
71+
"cmake-tools-build": {
72+
"description": "CMake build icon",
73+
"default": {
74+
"fontPath": "./res/product-icons.woff2",
75+
"fontCharacter": "\\E001"
76+
}
77+
},
78+
"cmake-tools-clean-configure": {
79+
"description": "CMake clean configure icon",
80+
"default": {
81+
"fontPath": "./res/product-icons.woff2",
82+
"fontCharacter": "\\E002"
83+
}
84+
},
85+
"cmake-tools-clean": {
86+
"description": "CMake clean icon",
87+
"default": {
88+
"fontPath": "./res/product-icons.woff2",
89+
"fontCharacter": "\\E003"
90+
}
91+
},
92+
"cmake-tools-cmake-view-1": {
93+
"description": "CMake view icon 1",
94+
"default": {
95+
"fontPath": "./res/product-icons.woff2",
96+
"fontCharacter": "\\E004"
97+
}
98+
},
99+
"cmake-tools-cmake-view-2": {
100+
"description": "CMake view icon 2",
101+
"default": {
102+
"fontPath": "./res/product-icons.woff2",
103+
"fontCharacter": "\\E005"
104+
}
105+
},
106+
"cmake-tools-configure": {
107+
"description": "CMake configure icon",
108+
"default": {
109+
"fontPath": "./res/product-icons.woff2",
110+
"fontCharacter": "\\E006"
111+
}
112+
}
113+
},
70114
"commands": [
71115
{
72116
"command": "cmake.openCMakePresets",
@@ -299,18 +343,12 @@
299343
{
300344
"command": "cmake.outline.configure",
301345
"title": "%cmake-tools.command.cmake.configure.title%",
302-
"icon": {
303-
"dark": "res/dark/configure-icon.svg",
304-
"light": "res/light/configure-icon.svg"
305-
}
346+
"icon": "$(cmake-tools-configure)"
306347
},
307348
{
308349
"command": "cmake.projectStatus.configure",
309350
"title": "%cmake-tools.command.cmake.configure.title%",
310-
"icon": {
311-
"dark": "res/dark/configure-icon.svg",
312-
"light": "res/light/configure-icon.svg"
313-
},
351+
"icon": "$(cmake-tools-configure)",
314352
"when": "cmake:enableFullFeatureSet",
315353
"category": "CMake"
316354
},
@@ -339,10 +377,7 @@
339377
{
340378
"command": "cmake.outline.configureAll",
341379
"title": "%cmake-tools.command.cmake.configureAll.title%",
342-
"icon": {
343-
"dark": "res/dark/configure-icon.svg",
344-
"light": "res/light/configure-icon.svg"
345-
}
380+
"icon": "$(cmake-tools-configure)"
346381
},
347382
{
348383
"command": "cmake.outline.configureAllWithDebugger",
@@ -360,28 +395,19 @@
360395
"command": "cmake.outline.build",
361396
"title": "%cmake-tools.command.cmake.build.title%",
362397
"when": "cmake:enableFullFeatureSet",
363-
"icon": {
364-
"dark": "res/dark/build-icon.svg",
365-
"light": "res/light/build-icon.svg"
366-
}
398+
"icon": "$(cmake-tools-build)"
367399
},
368400
{
369401
"command": "cmake.projectStatus.build",
370402
"title": "%cmake-tools.command.cmake.build.title%",
371403
"when": "cmake:enableFullFeatureSet",
372-
"icon": {
373-
"dark": "res/dark/build-icon.svg",
374-
"light": "res/light/build-icon.svg"
375-
}
404+
"icon": "$(cmake-tools-build)"
376405
},
377406
{
378407
"command": "cmake.outline.buildTarget",
379408
"title": "%cmake-tools.command.cmake.build.title%",
380409
"when": "cmake:enableFullFeatureSet",
381-
"icon": {
382-
"dark": "res/dark/build-icon.svg",
383-
"light": "res/light/build-icon.svg"
384-
}
410+
"icon": "$(cmake-tools-build)"
385411
},
386412
{
387413
"command": "cmake.showBuildCommand",
@@ -399,29 +425,20 @@
399425
"command": "cmake.outline.buildAll",
400426
"title": "%cmake-tools.command.cmake.buildAll.title%",
401427
"when": "cmake:enableFullFeatureSet",
402-
"icon": {
403-
"dark": "res/dark/build-icon.svg",
404-
"light": "res/light/build-icon.svg"
405-
}
428+
"icon": "$(cmake-tools-build)"
406429
},
407430
{
408431
"command": "cmake.compileFile",
409432
"title": "%cmake-tools.command.cmake.compileFile.title%",
410433
"category": "CMake",
411434
"when": "cmake:enableFullFeatureSet",
412-
"icon": {
413-
"dark": "res/dark/build-icon.svg",
414-
"light": "res/light/build-icon.svg"
415-
}
435+
"icon": "$(cmake-tools-build)"
416436
},
417437
{
418438
"command": "cmake.outline.compileFile",
419439
"title": "%cmake-tools.command.cmake.outline.compileFile.title%",
420440
"when": "cmake:enableFullFeatureSet",
421-
"icon": {
422-
"dark": "res/dark/build-icon.svg",
423-
"light": "res/light/build-icon.svg"
424-
}
441+
"icon": "$(cmake-tools-build)"
425442
},
426443
{
427444
"command": "cmake.install",
@@ -473,30 +490,21 @@
473490
"title": "%cmake-tools.command.cmake.projectStatus.cleanConfigure.title%",
474491
"when": "cmake:enableFullFeatureSet",
475492
"category": "CMake",
476-
"icon": {
477-
"dark": "res/dark/clean-configure-icon.svg",
478-
"light": "res/light/clean-configure-icon.svg"
479-
}
493+
"icon": "$(cmake-tools-clean-configure)"
480494
},
481495
{
482496
"command": "cmake.projectStatus.openSettings",
483497
"title": "%cmake-tools.command.cmake.openSettings.title%",
484498
"when": "cmake:enableFullFeatureSet",
485499
"category": "CMake",
486-
"icon": {
487-
"dark": "res/dark/settings-icon.svg",
488-
"light": "res/light/settings-icon.svg"
489-
}
500+
"icon": "$(settings-gear)"
490501
},
491502
{
492503
"command": "cmake.projectStatus.openVisibilitySettings",
493504
"title": "%cmake-tools.command.cmake.projectStatus.openVisibilitySettings.title%",
494505
"when": "cmake:enabelFullFeatureSet",
495506
"category": "CMake",
496-
"icon": {
497-
"dark": "res/dark/json-icon.svg",
498-
"light": "res/light/json-icon.svg"
499-
}
507+
"icon": "$(json)"
500508
},
501509
{
502510
"command": "cmake.cleanConfigureWithDebugger",
@@ -539,10 +547,7 @@
539547
"command": "cmake.outline.clean",
540548
"when": "cmake:enableFullFeatureSet",
541549
"title": "%cmake-tools.command.cmake.clean.title%",
542-
"icon": {
543-
"dark": "res/dark/clean-icon.svg",
544-
"light": "res/light/clean-icon.svg"
545-
}
550+
"icon": "$(cmake-tools-clean)"
546551
},
547552
{
548553
"command": "cmake.cleanAll",
@@ -3620,7 +3625,7 @@
36203625
{
36213626
"id": "cmake-view",
36223627
"title": "CMake",
3623-
"icon": "res/cmake-view-icon2.svg",
3628+
"icon": "$(cmake-tools-cmake-view-2)",
36243629
"when": "cmake:enableFullFeatureSet"
36253630
}
36263631
]
@@ -3699,7 +3704,8 @@
36993704
"extensionTestsSuccessfulBuild": "yarn run pretest && node ./out/test/extension-tests/successful-build/runTest.js",
37003705
"extensionTestsSingleRoot": "yarn run pretest && node ./out/test/extension-tests/single-root-UI/runTest.js",
37013706
"extensionTestsMultiRoot": "yarn run pretest && node ./out/test/extension-tests/multi-root-UI/runTest.js",
3702-
"backendTests": "node ./node_modules/mocha/bin/_mocha -u tdd --timeout 999999 --colors -r ts-node/register -r tsconfig-paths/register ./test/backend-unit-tests/**/*.test.ts"
3707+
"backendTests": "node ./node_modules/mocha/bin/_mocha -u tdd --timeout 999999 --colors -r ts-node/register -r tsconfig-paths/register ./test/backend-unit-tests/**/*.test.ts",
3708+
"build-product-icon-font": "yarn --cwd ./tools/product-icon-font-generator/ install && yarn --cwd ./tools/product-icon-font-generator/ build && node ./tools/product-icon-font-generator/dist/index.js --source-directory ./res/product-icons/ --output-directory ./res/ --woff2"
37033709
},
37043710
"devDependencies": {
37053711
"@octokit/rest": "^18.1.1",

res/dark/build-icon.svg

Lines changed: 0 additions & 8 deletions
This file was deleted.

res/dark/clean-configure-icon.svg

Lines changed: 0 additions & 27 deletions
This file was deleted.

res/dark/clean-icon.svg

Lines changed: 0 additions & 39 deletions
This file was deleted.

res/dark/configure-icon.svg

Lines changed: 0 additions & 4 deletions
This file was deleted.

res/dark/json-icon.svg

Lines changed: 0 additions & 4 deletions
This file was deleted.

res/dark/settings-icon.svg

Lines changed: 0 additions & 12 deletions
This file was deleted.

res/light/build-icon.svg

Lines changed: 0 additions & 8 deletions
This file was deleted.

res/light/json-icon.svg

Lines changed: 0 additions & 4 deletions
This file was deleted.

res/light/settings-icon.svg

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)