Hello, I’m afraid I am having trouble figuring out how to correctly add a menu item separator in a plugin:
How do I do this correctly? Using "name": "-" like in Vanilla doesn’t work, neither does an empty string (as you can see).
Is there any reference I can check for writing different menu items? Especially a fling-out menu would be a great help. Thanks!
For context, I have the following:
def conditionalContextMenus(self):
if self.condition_met:
conditionalMenus = [
{"name": Glyphs.localize({"en": u"Show affected glyphs"}),
"action": self.openTabWithAffectedGlyphs_},
# add a divider
{"name": "", "disabled": True, "action": None}
# add a submenu (fling-out)??
]
# Return list of context menu items
return conditionalMenus
In that case it’s best to add a new menu item and add the submenu there. Having a submenu on the same menu item that opens the filter is fairly confusing and thus seldomly done.
What is the best practice and convention if I need to separate the group of few items in context menu?
– Add separators above and below the group
– Add only one separator above, before the group
I’m thinking about the case when different plugins have context menu items with separators above and below, so separators from different plugins will make double line.