Is it possible to render a custom icon template on context menus?

On tree widgets, I was able to render a custom icon template with renderIcon.
Is there an equivalent with menus? or is it just icon and iconClass?

[original thread by Harley Dela Cruz]

Right now it is not possible. We will need to expose menu widget renderer. Please file a feature request.

[Harley Dela Cruz]

@bobharley i don’t think active committers will look into it, you can try to send a PR, probably the first iteration won’t be acceptable, but we can help you iterate from there

[Hanksha]

@anton-kosyakov Is it possible to add icons to electron app context menus?

@hanksha unfortunately i don’t know, you will need to consult Electron docs

it seems to be possible: https://electronjs.org/docs/api/menu-item#menuitemicon

actually i would expect if you register a menu action using theia MenuContribution with `icon attribute then it would be already used

is not it the case, i think then it is a bug

[Hanksha]

Yes I checked the docs yesterday and saw it was possible but I doubt it’s using an icon class, the string value must be a file path I guess (or NativeImage). So if we want to use both icon classes (for the browser) and icon files for electron native menus it would need an extra field in Command and MenuAction ?

@thegecko @spoenemann Did you use icons in menus with Theia?

[Rob Moran]

We dont