nodegui / react-nodegui

Build performant, native and cross-platform desktop applications with native React + powerful CSS like styling.🚀
https://react.nodegui.org
MIT License
6.18k stars 171 forks source link

Can I create submenus for System Tray Menu Actions? #375

Open rsshilli opened 2 years ago

rsshilli commented 2 years ago

Hello,

First, thank you for creating this package! It's really nice.

I'd like to create a submenu for one of my action items in my system tray. For example, I have something like:

    <SystemTrayIcon icon={icon} visible>
      <Menu>
         <Action text="Do something"/>
      </Menu>
    </SystemTrayIcon>

And I'd like to make a submenu for my action. So something like:

    <SystemTrayIcon icon={icon} visible>
      <Menu>
         <Action text="Do something">
            <Menu>
               <Action text="Show"/>
               <Action text="Hide"/>
            </Menu>
         </Action>
      </Menu>
    </SystemTrayIcon>

Very similar to what's being shown off here: https://github.com/nodegui/examples/blob/master/nodegui/systray/src/index.ts#L35-L55

Is this possible today? If not, could you please add it, or give me some direction on where to add it?

Ryan