Mercurial > libervia-web
comparison browser_side/menu.py @ 79:d57e0d6b1ced
browser side: inclusion of Adrien's icons
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 19 Jun 2011 16:35:44 +0200 |
parents | 12680e220b35 |
children | 500a1529c191 |
comparison
equal
deleted
inserted
replaced
78:12680e220b35 | 79:d57e0d6b1ced |
---|---|
67 | 67 |
68 def __init__(self, host): | 68 def __init__(self, host): |
69 self.host = host | 69 self.host = host |
70 SimplePanel.__init__(self) | 70 SimplePanel.__init__(self) |
71 self.setStyleName('menuContainer') | 71 self.setStyleName('menuContainer') |
72 _item_tpl = "<img src='media/icons/menu/%s_menu_red.png' />%s" | |
72 | 73 |
73 menu_general = MenuBar(vertical=True) | 74 menu_general = MenuBar(vertical=True) |
74 menu_general.addItem("Social contract", MenuCmd(self, "onSocialContract")) | 75 menu_general.addItem("Social contract", MenuCmd(self, "onSocialContract")) |
75 menu_general.addItem("About", MenuCmd(self, "onAbout")) | 76 menu_general.addItem("About", MenuCmd(self, "onAbout")) |
76 | 77 |
84 | 85 |
85 menu_games = MenuBar(vertical=True) | 86 menu_games = MenuBar(vertical=True) |
86 menu_games.addItem("Tarot", MenuCmd(self, "onTarotGame")) | 87 menu_games.addItem("Tarot", MenuCmd(self, "onTarotGame")) |
87 menu_games.addItem("Xiangqi", MenuCmd(self, "onXiangqiGame")) | 88 menu_games.addItem("Xiangqi", MenuCmd(self, "onXiangqiGame")) |
88 | 89 |
90 menu_help = MenuBar(vertical=True) | |
91 | |
92 menu_settings = MenuBar(vertical=True) | |
93 | |
89 menubar = LiberviaMenuBar() | 94 menubar = LiberviaMenuBar() |
90 menubar.addItem(MenuItem("General", menu_general)) | 95 |
91 menubar.addItem(MenuItem("Contacts", menu_contacts)) | 96 for _name, _icon, _menu in [('General', 'home', menu_general), |
92 menubar.addItem(MenuItem("Groups", menu_group)) | 97 ('Contacts', 'social', menu_contacts), |
98 ('Groups', 'social', menu_group), | |
99 ('Games', 'games', menu_games)]: | |
100 menubar.addItem(MenuItem(_item_tpl % (_icon, _name), True, _menu)) | |
101 | |
93 _separator = MenuItem('', None) | 102 _separator = MenuItem('', None) |
94 _separator.setStyleName('menuSeparator') | 103 _separator.setStyleName('menuSeparator') |
95 menubar.addItem(_separator, None) | 104 menubar.addItem(_separator, None) |
96 menubar.addItem(MenuItem("Games", True, menu_games)) | 105 |
106 for _name, _icon, _menu in [('Help', 'help', menu_help), | |
107 ('Settings', 'settings', menu_settings)]: | |
108 menubar.addItem(MenuItem(_item_tpl % (_icon, _name), True, _menu)) | |
109 | |
97 self.add(menubar) | 110 self.add(menubar) |
98 | 111 |
99 #General menu | 112 #General menu |
100 def onSocialContract(self): | 113 def onSocialContract(self): |
101 _frame = Frame('contrat_social.html') | 114 _frame = Frame('contrat_social.html') |