phosphorjs / phosphor

The PhosphorJS Library
BSD 3-Clause "New" or "Revised" License
1.04k stars 166 forks source link

Enable setting context menu icon #428

Closed btheeten closed 4 years ago

btheeten commented 4 years ago

It seems the phosphorjs context menus include an icon, which (according to the code) needs to be set through an iconClass. However setting this iconClass doesn't seem to be exposed through the IItemOptions interface.

sccolbert commented 4 years ago

The content for a menu item is provided by the underlying command. You add the iconClass when you register the command in the CommandRegistry.

btheeten commented 4 years ago

Thank you very much for the quick answer. That solves my problem.