GNOME Bugzilla – Bug 375419
Need a "toplevel" placeholder in menubar (gedit-ui.xml) for a plugin menu
Last modified: 2006-11-25 17:41:01 UTC
I have a plugin (http://artfwo.googlepages.com/sced) that adds its own menu to the toplevel menubar (not immediately upon startup, but when a mode is toggled). When I merge the new ui at runtime, the menu is added into the very end, after the "Help" menu, so I suggest adding a placeholder element in gedit-ui.xml like this: <menu name="ToolsMenu" action="Tools"> ... </menu> <!-- ADD THIS --> <placeholder name="PluginMenu_1" /> <!-- ADD THIS --> <menu name="DocumentsMenu" action="Documents"> ... </menu> Modifying gedit-ui.xml made things look well for me. I file this bug, because I think there may be other plugins that will want to have their toplevel menus in the future.
It looks list a good idea. Could you please provide a patch for gedit-ui-xml that adds placeholders between all the "menus"?
I don't think we need one placeholder between every menu. I think what Артём proposed is good: we should allow extensions to add toplevel menus only after the gedit core menus but before the help menu which should always be last. Otherwise we encourage plugins to mess up the UI too much.
Just my 2 cents. I think that a placeholder (or maybe several of 'em in a row?) for plugin-specific menus should be placed before the Documents menu or the Tools menu, but definetly NOT after Documents (that looks great being second to the last one: Help) So it will look either like: <menu name="ToolsMenu" action="Tools"> ... </menu> <placeholder name="PluginMenus" /> <menu name="DocumentsMenu" action="Documents"> ... </menu> Or: <menu name="ToolsMenu" action="Tools"> ... </menu> <placeholder name="PluginMenu_1" /> <placeholder name="PluginMenu_2" /> ... <menu name="DocumentsMenu" action="Documents"> ... </menu> There're 5 placeholders in Tools, maybe make 5 placeholders for toplevels as well?
having more than one placeholder doesn't help much IMHO: a placeholder can be used many times. In the Tools menu etc we have many placeholders so that we can ensure some ordering of the menu items when more than a plugin is activated: this is possible because we are talking about internal plugins where we can assume some ordering and make them use specific placeholders. The toplevel placeholder will be used by external plugins only and I doubt that some ordering can be kept, so I don't see much point in having more placeholders. About the position, I have no strong opinion about placing it before Documents, though I still think it makes sense to add it _after_ all the standard menus and thus after Documents. What I am convinced is that we should allow only one extension point.
Agreed. As for why before Documents question, it's just some common practice, I think. Unfortunately, the HIG says nothing on the subject, only recommends placing app-specific menus closer to the center of the menubar: http://developer.gnome.org/projects/gup/hig/2.0/menus-standard.html Note, that many IDEs, office suits, etc. have Documents (maybe named Windows or smth like that) menu just before Help, everything else goes before those 2, even those "special", specific menus.
You guys are right, I did't think too much before replying. It is ok for me to put the placeholder between Tools and Documents.
Created attachment 76890 [details] [review] A patch that adds placeholders for plugin menus and toolitems A trivial patch that adds PluginMenus placeholder to the menubar, and PluginToolItems placeholder to the toolbar.
I fixed this in cvs, sorry for the delay. I decided to call the placeholder ExtraMenu_1, so that it's more consistent with the other placeholders and if needed we can add _2, _3 etc. I didn't add the toolbars placeholders: you can attach buttons at the end of the toolbar without any placeholder.