Skip to content

Commit

Permalink
Use product icons instead of 'hardcoded' icons (#3737)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
DeltaRazero authored Oct 17, 2024
1 parent 925119f commit e765b1e
Show file tree
Hide file tree
Showing 21 changed files with 448 additions and 172 deletions.
114 changes: 60 additions & 54 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,50 @@
],
"main": "./dist/main",
"contributes": {
"icons": {
"cmake-tools-build": {
"description": "CMake build icon",
"default": {
"fontPath": "./res/product-icons.woff2",
"fontCharacter": "\\E001"
}
},
"cmake-tools-clean-configure": {
"description": "CMake clean configure icon",
"default": {
"fontPath": "./res/product-icons.woff2",
"fontCharacter": "\\E002"
}
},
"cmake-tools-clean": {
"description": "CMake clean icon",
"default": {
"fontPath": "./res/product-icons.woff2",
"fontCharacter": "\\E003"
}
},
"cmake-tools-cmake-view-1": {
"description": "CMake view icon 1",
"default": {
"fontPath": "./res/product-icons.woff2",
"fontCharacter": "\\E004"
}
},
"cmake-tools-cmake-view-2": {
"description": "CMake view icon 2",
"default": {
"fontPath": "./res/product-icons.woff2",
"fontCharacter": "\\E005"
}
},
"cmake-tools-configure": {
"description": "CMake configure icon",
"default": {
"fontPath": "./res/product-icons.woff2",
"fontCharacter": "\\E006"
}
}
},
"commands": [
{
"command": "cmake.openCMakePresets",
Expand Down Expand Up @@ -299,18 +343,12 @@
{
"command": "cmake.outline.configure",
"title": "%cmake-tools.command.cmake.configure.title%",
"icon": {
"dark": "res/dark/configure-icon.svg",
"light": "res/light/configure-icon.svg"
}
"icon": "$(cmake-tools-configure)"
},
{
"command": "cmake.projectStatus.configure",
"title": "%cmake-tools.command.cmake.configure.title%",
"icon": {
"dark": "res/dark/configure-icon.svg",
"light": "res/light/configure-icon.svg"
},
"icon": "$(cmake-tools-configure)",
"when": "cmake:enableFullFeatureSet",
"category": "CMake"
},
Expand Down Expand Up @@ -339,10 +377,7 @@
{
"command": "cmake.outline.configureAll",
"title": "%cmake-tools.command.cmake.configureAll.title%",
"icon": {
"dark": "res/dark/configure-icon.svg",
"light": "res/light/configure-icon.svg"
}
"icon": "$(cmake-tools-configure)"
},
{
"command": "cmake.outline.configureAllWithDebugger",
Expand All @@ -360,28 +395,19 @@
"command": "cmake.outline.build",
"title": "%cmake-tools.command.cmake.build.title%",
"when": "cmake:enableFullFeatureSet",
"icon": {
"dark": "res/dark/build-icon.svg",
"light": "res/light/build-icon.svg"
}
"icon": "$(cmake-tools-build)"
},
{
"command": "cmake.projectStatus.build",
"title": "%cmake-tools.command.cmake.build.title%",
"when": "cmake:enableFullFeatureSet",
"icon": {
"dark": "res/dark/build-icon.svg",
"light": "res/light/build-icon.svg"
}
"icon": "$(cmake-tools-build)"
},
{
"command": "cmake.outline.buildTarget",
"title": "%cmake-tools.command.cmake.build.title%",
"when": "cmake:enableFullFeatureSet",
"icon": {
"dark": "res/dark/build-icon.svg",
"light": "res/light/build-icon.svg"
}
"icon": "$(cmake-tools-build)"
},
{
"command": "cmake.showBuildCommand",
Expand All @@ -399,29 +425,20 @@
"command": "cmake.outline.buildAll",
"title": "%cmake-tools.command.cmake.buildAll.title%",
"when": "cmake:enableFullFeatureSet",
"icon": {
"dark": "res/dark/build-icon.svg",
"light": "res/light/build-icon.svg"
}
"icon": "$(cmake-tools-build)"
},
{
"command": "cmake.compileFile",
"title": "%cmake-tools.command.cmake.compileFile.title%",
"category": "CMake",
"when": "cmake:enableFullFeatureSet",
"icon": {
"dark": "res/dark/build-icon.svg",
"light": "res/light/build-icon.svg"
}
"icon": "$(cmake-tools-build)"
},
{
"command": "cmake.outline.compileFile",
"title": "%cmake-tools.command.cmake.outline.compileFile.title%",
"when": "cmake:enableFullFeatureSet",
"icon": {
"dark": "res/dark/build-icon.svg",
"light": "res/light/build-icon.svg"
}
"icon": "$(cmake-tools-build)"
},
{
"command": "cmake.install",
Expand Down Expand Up @@ -473,30 +490,21 @@
"title": "%cmake-tools.command.cmake.projectStatus.cleanConfigure.title%",
"when": "cmake:enableFullFeatureSet",
"category": "CMake",
"icon": {
"dark": "res/dark/clean-configure-icon.svg",
"light": "res/light/clean-configure-icon.svg"
}
"icon": "$(cmake-tools-clean-configure)"
},
{
"command": "cmake.projectStatus.openSettings",
"title": "%cmake-tools.command.cmake.openSettings.title%",
"when": "cmake:enableFullFeatureSet",
"category": "CMake",
"icon": {
"dark": "res/dark/settings-icon.svg",
"light": "res/light/settings-icon.svg"
}
"icon": "$(settings-gear)"
},
{
"command": "cmake.projectStatus.openVisibilitySettings",
"title": "%cmake-tools.command.cmake.projectStatus.openVisibilitySettings.title%",
"when": "cmake:enabelFullFeatureSet",
"category": "CMake",
"icon": {
"dark": "res/dark/json-icon.svg",
"light": "res/light/json-icon.svg"
}
"icon": "$(json)"
},
{
"command": "cmake.cleanConfigureWithDebugger",
Expand Down Expand Up @@ -539,10 +547,7 @@
"command": "cmake.outline.clean",
"when": "cmake:enableFullFeatureSet",
"title": "%cmake-tools.command.cmake.clean.title%",
"icon": {
"dark": "res/dark/clean-icon.svg",
"light": "res/light/clean-icon.svg"
}
"icon": "$(cmake-tools-clean)"
},
{
"command": "cmake.cleanAll",
Expand Down Expand Up @@ -3620,7 +3625,7 @@
{
"id": "cmake-view",
"title": "CMake",
"icon": "res/cmake-view-icon2.svg",
"icon": "$(cmake-tools-cmake-view-2)",
"when": "cmake:enableFullFeatureSet"
}
]
Expand Down Expand Up @@ -3699,7 +3704,8 @@
"extensionTestsSuccessfulBuild": "yarn run pretest && node ./out/test/extension-tests/successful-build/runTest.js",
"extensionTestsSingleRoot": "yarn run pretest && node ./out/test/extension-tests/single-root-UI/runTest.js",
"extensionTestsMultiRoot": "yarn run pretest && node ./out/test/extension-tests/multi-root-UI/runTest.js",
"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"
"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",
"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"
},
"devDependencies": {
"@octokit/rest": "^18.1.1",
Expand Down
8 changes: 0 additions & 8 deletions res/dark/build-icon.svg

This file was deleted.

27 changes: 0 additions & 27 deletions res/dark/clean-configure-icon.svg

This file was deleted.

39 changes: 0 additions & 39 deletions res/dark/clean-icon.svg

This file was deleted.

4 changes: 0 additions & 4 deletions res/dark/configure-icon.svg

This file was deleted.

4 changes: 0 additions & 4 deletions res/dark/json-icon.svg

This file was deleted.

12 changes: 0 additions & 12 deletions res/dark/settings-icon.svg

This file was deleted.

8 changes: 0 additions & 8 deletions res/light/build-icon.svg

This file was deleted.

4 changes: 0 additions & 4 deletions res/light/json-icon.svg

This file was deleted.

12 changes: 0 additions & 12 deletions res/light/settings-icon.svg

This file was deleted.

Binary file added res/product-icons.woff2
Binary file not shown.
1 change: 1 addition & 0 deletions res/product-icons/uE001_build-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Loading

0 comments on commit e765b1e

Please sign in to comment.