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

add separator support unreal #32

Open
hannesdelbeke opened this issue Apr 6, 2023 · 2 comments
Open

add separator support unreal #32

hannesdelbeke opened this issue Apr 6, 2023 · 2 comments
Labels

Comments

@hannesdelbeke
Copy link
Owner

a section needs to first be added
then we set section name in the labels/command entries

# create section named test
return parent_app_node.add_section(section_name="test", label=self.label + "_label", insert_name="test_insert_name")
# assign entry to section test
parent_app_node.add_menu_entry("test", entry)
@JLHayde
Copy link
Contributor

JLHayde commented Jul 25, 2023

With our latest changes to be able set section_name from kwarg we can then set the section_name for the separator, but have to define it for each subsequent item that you want to be under that separator in the config.

I have found another solution which can still use the above. but also can do this in the background without needing to setup some additional flags for the config.
https://github.com/JLHayde/unimenu/blob/2fa3c54a2a7f534781482fc264ed44daeaffe9aa/unimenu/apps/unreal.py#L136-L151

image

MainToolbar = {
    'label': f'Studio: 11111',

    'items':

        [
            {
                'label': 'UV Tools',
                'separator': True,
                "tooltip": "tooltip separator",
            },
            {
                'command': 'remote.send_message_to_server(host_port, "Hello from unimenu")',
                'label': 'Tool 1',
                "icon": "MessageLog.TabIcon",
                "tooltip": "tooltip",


            },

            {
                'command': 'remote.send_message_to_server(host_port, "Hello from unimenu")',
                'label': 'Tool 2',
                "icon": "MessageLog.TabIcon",
                "tooltip": "tooltip",


            },
            {
                'label': 'Mesh Tools',
                'separator': True,
                "tooltip": "tooltip separator",
            },
            {
                'command': 'remote.send_message_to_server(host_port, "Hello from unimenu")',
                'label': 'Tool 3',
                "icon": "MessageLog.TabIcon",
                "tooltip": "tooltip",

            },

            {
                'command': 'remote.send_message_to_server(host_port, "Hello from unimenu")',
                'label': 'Tool 4',
                "icon": "MessageLog.TabIcon",
                "tooltip": "tooltip",

            },
            {
                'label': 'Tools',
                'items':
                    [
                        {
                            'label': 'Faces',
                            'separator': True,
                            "tooltip": "tooltip separator",
                        },
                        {
                            'command': 'print("hello 1")',
                            'label': 'tool8',
                            'icon': "MessageLog.TabIcon"
                        },
                        {
                            'command': 'print("hello 2")',
                            'label': 'tool9',
                            'icon': "MessageLog.TabIcon"
                        }
                    ]
            }
        ]
}

@hannesdelbeke
Copy link
Owner Author

that looks good, can you get a PR for that?

@hannesdelbeke hannesdelbeke added the enhancement New feature or request label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants