Skip to content
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

How are submenus supposed to work? #157

Closed
jesobreira opened this issue Jun 14, 2018 · 5 comments · May be fixed by kwizeraelvis/proton-native#2
Closed

How are submenus supposed to work? #157

jesobreira opened this issue Jun 14, 2018 · 5 comments · May be fixed by kwizeraelvis/proton-native#2

Comments

@jesobreira
Copy link

jesobreira commented Jun 14, 2018

The docs are clear:

The menu must come outside and before the Window for it to take effect. It is made up of Menu.Items. Menus can be embedded inside eachother to make sub-menus.

However, this:

<Menu label="Tools">
            <Menu.Item type="Preferences" />
            <Menu.Item>Network</Menu.Item>
            <Menu.Item type="Separator" />
            <Menu.Item>Sign Message</Menu.Item>
            <Menu label="Load Transaction">
                      <Menu.Item>From file</Menu.Item>
                      <Menu.Item>From text</Menu.Item>
            </Menu>
</Menu>

Causes this:

captura de tela 2018-06-14 as 00 05 06

At least on Mac OS X 10.13.2, the "Load Transaction" item is rather created as a main menu, and not as submenu, despite it being inside a <Menu> item.

How was this supposed to be done? Perhaps an example on it could be added to the docs.

Note: I only tested it on OS X.

@mischnic
Copy link
Contributor

Submenues aren't supported. The docs are wrong.

@jesobreira
Copy link
Author

I see. Is this a libui limitation? Or it's something I can help with, on proton-native sphere?

@parro-it
Copy link
Contributor

Is this a libui limitation?

Yes, ATM. See also andlabs/libui#321 and parro-it/libui-node#110

@jesobreira
Copy link
Author

Got it. May I create a PR that fixes the docs about it?

I also find it interesting to note that menus can be created inside <React.Fragment> tags, so that users are able to import menus from external files.

@mischnic
Copy link
Contributor

Got it. May I create a PR that fixes the docs about it?

Sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants