-
Notifications
You must be signed in to change notification settings - Fork 9
features overview
hannes edited this page Feb 15, 2023
·
36 revisions
- ❌ Not easily supported ( with current UniMenu implementation )
- ✅ Implemented
- 🛠️ To implement
- Not investigated yet
App | native icons | custom icons | Separator | Labeled separator | callback command ¹ | tooltip | teardown | native UI |
---|---|---|---|---|---|---|---|---|
Qt | ✅ | ✅ | ✅ | ✅ | ✅ | 🛠️ | any Qt | |
Maya | 🛠️ | ✅ | 🛠️ | ✅ | ❌ | ✅ | PySide2 & native menu | |
Max ² | 🛠️ | ✅ | ❌ | ❌ | 🛠️ | PySide2 & native menu | ||
Substance Painter | PySide2 | |||||||
Krita ³ | ✅ | ❌ | ✅ | ✅ | ✅ | 🛠️ | PyQt5 | |
Blender | ✅ | 🛠️ | ✅ | ❌ | ❌ | 🛠️ | GHOST Menu Operator | |
Unreal | 🛠️ | 🛠️ | 🛠️ | 🛠️ | Slate ToolMenuEntry | |||
Marmoset | ❌ | ❌ | ❌ | ❌ | UIWindow |
Additional info
¹ some apps only support string commands, some support passing functions & callbacks.²
³ Some Krita features should be doable with PyQt5 but don't work by default. They likely are disabled in the parent QT window. Not yet figured out how to enable e.g. tooltips or icons, and the default menu entries don't use them either.
⁴ Support for labeled separators, depends on the stylesheet used. The default Qt one wont show this. But without any additional code, this works in e.g. Krita.
¹²³⁴⁵⁶⁷⁸⁹⁰
- checkbox, e.g. Krita
- shortcuts - Krita, Blender, Unreal
- option button, e.g. maya every menu item can have several attributes. The core attributes are label and command
- see QT apps on Wikipedia
- CryEngine
- ROBLOX studio
- GODOT
- Unity
- Photoshop, after effects, illustrator, …
- houdini
- substance designer
attribute | description |
---|---|
command | the action to run when clicking the item |
label | the label displayed in the menu for this item. (Don't confuse label with name) |
name | the name used in the code or by the app for this item. Often required to be unique so be carefull ! |
icon | name of the icon, or path to the icon, an icon next to the menu entry TODO do we support QIcons? |
separator | if set to a non False value, this item will be treated as a separator. Some apps support labeled separators |
items = children | the child nodes of a menu or submenu. |
parent_path | Only set in config for the root node. Controls where & how your menu is parented too. Behaviour can differ between apps, depending on implementation! |
This sample shows of all attributes in use. Checkout the samples in the UniMenu repo for more configs.
parent_path: MainWindow
label: UniMenu
items:
- label: Item 1
command: print('Item 1')
icon: QUESTION.png
tooltip: you can read this when you hover over me
- separator: 1
label: labeled separator
The attributes can also be accessed on the MenuNode
, if we load the above config in unimenu.
node = unimenu.load(config)
node.parent_path # "MainWindow"
node.label # "UniMenu"
nodes = node.children
node1 = nodes[0]
node2 = nodes[1]
node1.label # "Item 1"
node1.tooltip # "you can read this when you hover over me"
node1.command # "print('Item 1')"
node1.icon # "QUESTION.png"
node2.separator # 1, could also be set to True, or "--"
node2.label # "labeled separator"
# =========== Helper functions ===========
# run the command, return value depends on the application integration
node1.run()
# find out if a node is a separator
node2.is_separator()
# get a node's parent. When you ask the parent of a non-root-menuNode,
# it'll return the parent MenuNode.
# This attribute isn't explicitly saved back to the config.
parent_node = node2.parent
Applications
Dev Docs
Other