microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.69k stars 28.69k forks source link

File Icon Themes require baked-in padding #209860

Closed dpetroff closed 5 months ago

dpetroff commented 5 months ago

Does this issue occur when all extensions are disabled?: Yes

Steps to Reproduce:

  1. Use a font that does not bake padding into the glyphs to create a file icon theme:
    {
    "fonts": [
      {
        "id": "fontawesome",
        "src": [
          {
            "format": "woff2",
            "path": "./fontawesome-webfont.woff2"
          }
        ]
      }
    ],
    "iconDefinitions": {
      "gavel-file": {
        "fontId": "fontawesome",
        "fontCharacter": "\\F0E3"
      }
    },
    "fileExtensions": {
      "gavel": "gavel-file"
    }
    }
  2. The icons are slammed into the twisty in the Explorer view and offset to the left in the editor tab and breadcrumbs: image
  3. Compare this with the default icons which come with baked-in padding: image

It should not be necessary to bake the padding into the icon glyphs. This is not an issue when the same icon is used from a custom codicon in a TreeView by adding an item with iconPath: new ThemeIcon("gavel-file"):

"icons": {
  "gavel-file": {
    "description": "Gavel File Icon",
    "default": {
      "fontPath": "./fontawesome-webfont.woff2",
      "fontCharacter": "\\F0E3"
    }
  }
}

The logic used here produces a much more consistent icon so perhaps it should be reused in other parts of the product like the Explorer view and the editor tab and breadcrumbs: image

aeschli commented 5 months ago

Sorry, we're not going to make any changes in the icon sizing / positions. This is how it grew historically.

aeschli commented 3 months ago

Of course everyone is welcome to investigate here and come up with a backward compatible solution. The solution needs to be well tested (all platforms, existing icon and product theme and extensions that contribute icons and language icons). Also, I'd need some commitment to help managing issues that get reported in that area, to figure out if the change has caused any regressions.