New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] Menu icons - is there an option to enable / disable them && is using for FontAwesome icons possible #60
Comments
The icon view is based on the new Microsoft Edge (Chromium), so you cannot remove the extra space left on the left side of the menu item. If you use a checkbox item, the icon is check. It is not possible to add fontawesome icons, as the variable for icon that provides electron is used. In any case, I'll check it out and be reporting the progress right here. |
Thanks - so i was guessing right. Having access to fontawesome would it make much easier to fill all those icons needed for a complex menu ... but i understand if that's not the project target.
So should i keep the issue open as you consider supporting it? |
I haven't tried it yet but you should be able to use fontawesome icons directly using their SVGs. See: https://github.com/FortAwesome/Font-Awesome/tree/master/svgs |
Hi @janvorisek
Seems like it doesnt work. I did try with a classic image like in the example - that works
Then i tried applying that to an fontawesome svg like that
This throws no error, but the entire submenu entry is missing So while my file menu containes
it then only showed
|
@yafp That's strange. Can you check if SVGs are loading correctly in your app (webpack/rollup config)? It's still strange that the item is missing. I'd expect an error/empty image instead. |
@yafp Converting the icons you want into PNGs and including them in your app may be possible too. Brutal but could be a temporary solution 😄 |
Oh, i have to correct myself. Not only the 1 item is missing - instead it seems like my app is falling back to the electron default menu entries. |
I have to correct myself as well. I investigated electron menu a bit and the icon accepts NativeImage which cant be SVG according to the electron docs. My current idea is to load the SVGs in my app main.ts using webpack and manually converting each into a NativeImage which can then be supplied directly to the MenuItem item prop. I'll share some sample code if I am successful 😄. I am also curious for any simpler solutions/examples. |
Good catch, thanks @janvorisek for the sake of completeness While trying to use the .svg my error reporting using Sentry game me the following:
While i noticed no error output in the console. No idea if it's possible to handle that better to prevent falling back to the default menu. |
to sum it up:
|
I noticed you added with #43 support for menu icons.
so far i haven't added any icon to my menu - which results in empty space. See the attached screenshot.
Is there an option to enable or disable the menu icons?
Additional question:
Have you ever tried using fontawesome as a source for electron menu icons?
The text was updated successfully, but these errors were encountered: