VSpaceCode / vscode-which-key

which-key like menu for Visual Studio Code
https://vspacecode.github.io/docs/whichkey
MIT License
166 stars 18 forks source link

Ability to specify font for menu "keys" #80

Open macintacos opened 11 months ago

macintacos commented 11 months ago

Problem

For example, if the l and I menu options are next to each other, because the default sans-serif font displays the keys, they look remarkably identical to one another.

Solution

I know I can (probably?) solve it with CSS, but it'd be great if it were an option to set your own font for the menu items. Personally, I'd set it to a monospace font, since this is basically a solved problem with those for the most part.

Alternatives

Can use CSS - I will in the meantime, but it'd be nice if it were supported in the extension itself

MarcoIeni commented 11 months ago

Switching l with I is the story of my life (take a look at my surname 😅) Imo we could add the font as a setting similar to how vscode does. Not sure how feasible it is. image

macintacos commented 11 months ago

Yeah I took a stab at trying to use CSS to set it, and unfortunately it's not quite so straightforward since the component used seems to be a generic one. Every class I've tried to set seems to impact something else somewhere else in the UI that I don't want touched - literally just want the labels to be monospace and nothing else (even if other "menus" are invoked that use the same generic component).

I'm not sure what you can do here since this might be a VSCode limitation - is it possible to add CSS classes for the rows in the quick input panel that users can more readily target?

stevenguh commented 11 months ago
image

We have a setting which uses fullwidth characters in CJK to workaround the spacing issue. We can consider adding other options such as Mathematical Alphanumeric Symbols which often has a built-in "style" to the character.

macintacos commented 11 months ago

Personally, I'd like to be able to specify a font of my choice, but if that's not possible then I'd gladly accept whatever would help disambiguate all characters used for keys.

stevenguh commented 11 months ago

Since we are using VScode menu API, I doubt they would allow special customization any time soon.

But there is some quick result using math monospace character block

image
photkey commented 8 months ago

It should be possible to customize the font using the Apc Customize UI++ plugin, but I don't know how to make the modifications. If anyone can provide the correct instructions, I would greatly appreciate it! Here is an example of someone who successfully made modifications: https://github.com/drcika/apc-extension/issues/39#issuecomment-1622622022

fgimian commented 1 month ago

As an additional question to this, is there a way to set the font and font size for the menu? I do notice the text is quite a lot smaller and looks different to the usual Ctrl+Shift+P and Ctrl+P menus. 😄

Cheers Fotis