Mercurial > libervia-web
diff src/browser/sat_browser/menu.py @ 502:4aa627b059df
browser_side: categories of the menus can be "flattened":
- add the parameter "flat_level" to GenericMenuBar
- the items of flattened sub-menus are displayed in the parent menu
XXX: the implementation covers the current needs but is not fully completed:
- the flattened categories of all levels are displayed the same way
- items of flattened categories are appended to the parent menus instead of being inserted
author | souliane <souliane@mailoo.org> |
---|---|
date | Wed, 13 Aug 2014 15:06:40 +0200 |
parents | 67a4e8383b70 |
children | 35ccb3ff8245 |
line wrap: on
line diff
--- a/src/browser/sat_browser/menu.py Wed Aug 13 18:36:57 2014 +0200 +++ b/src/browser/sat_browser/menu.py Wed Aug 13 15:06:40 2014 +0200 @@ -49,7 +49,7 @@ base_menu.GenericMenuBar.__init__(self, host, vertical=False, styles=styles) @classmethod - def getCategoryHTML(cls, type_, menu_name_i18n): + def getCategoryHTML(cls, menu_name_i18n, type_): return cls.ITEM_TPL % (type_, menu_name_i18n) @@ -68,7 +68,7 @@ def createMenus(self): self.addMenuItem("General", [_("General"), _("Web widget")], 'home', MenuCmd(self, "onWebWidget")) self.addMenuItem("General", [_("General"), _("Disconnect")], 'home', MenuCmd(self, "onDisconnect")) - self.addMenuItem("Contacts", [_("Contacts"), None], 'social', None) + self.addMenuItem("Contacts", [_("Contacts"), None], 'social') # save the position for this category self.addMenuItem("Groups", [_("Groups"), _("Discussion")], 'social', MenuCmd(self, "onJoinRoom")) self.addMenuItem("Groups", [_("Groups"), _("Collective radio")], 'social', MenuCmd(self, "onCollectiveRadio")) self.addMenuItem("Games", [_("Games"), _("Tarot")], 'games', MenuCmd(self, "onTarotGame"))