feat: Add support for displaying contextual menus on icons by gonfunko · Pull Request #9581 · RaspberryPiFoundation/blockly
The basics
The details
Resolves
Fixes #3568
Proposed Changes
This PR builds on #9580 (it will be rebased once that is merged) to allow icons to display contextual menus. This can be done by simply overriding/implementing showContextMenu() on an IIcon to show a contextual menu with the desired options. By default, icons defer to their parent block's contextual menu, which matches the current behavior when one right clicks on an icon.