@@ -104,6 +104,14 @@ class ThemeTopPanel(models.Model):
104104 default = False , help = "Active item Background color for Top Panel"
105105 )
106106
107+ top_panel_active_subitem_bg = fields .Char (
108+ "Active submenu item Background color" ,
109+ help = "Active item Background color for Top Panel" ,
110+ )
111+ top_panel_active_subitem_bg_active = fields .Boolean (
112+ default = False , help = "Active submenu item Background color for Top Panel"
113+ )
114+
107115 top_panel_hover_item_font = fields .Char (
108116 "Hover item Font color" , help = "Hover item Font color for Top Panel"
109117 )
@@ -117,6 +125,12 @@ class ThemeTopPanel(models.Model):
117125 top_panel_hover_item_bg_active = fields .Boolean (
118126 default = False , help = "Hover item Background color for Top Panel"
119127 )
128+ top_panel_hover_subitem_bg = fields .Char (
129+ "Hover submenu item Background color" , help = "Hover item Background color for Top Panel"
130+ )
131+ top_panel_hover_subitem_bg_active = fields .Boolean (
132+ default = False , help = "Hover submenu item Background color for Top Panel"
133+ )
120134
121135 # Compatibility theme_kit and material backend theme modules
122136 left_panel_main_menu = fields .Char (
@@ -163,10 +177,14 @@ def write(self, vals):
163177 self .top_panel_hover_item_font = ""
164178 if not vals .get ("top_panel_hover_item_bg_active" , "Not found" ):
165179 self .top_panel_hover_item_bg = ""
180+ if not vals .get ("top_panel_hover_subitem_bg_active" , "Not found" ):
181+ self .top_panel_hover_subitem_bg = ""
166182 if not vals .get ("left_panel_main_menu_active" , "Not found" ):
167183 self .left_panel_main_menu = ""
168184 if not vals .get ("left_panel_sub_menu_active" , "Not found" ):
169185 self .top_panel_hover_item_bg = ""
186+ if not vals .get ("top_panel_active_subitem_bg_active" , "Not found" ):
187+ self .top_panel_active_subitem_bg = ""
170188
171189 @api .multi
172190 def _compute_less (self ):
@@ -310,6 +328,16 @@ def _compute_less(self):
310328 code
311329 + """.navbar-nav .active a{{
312330 background-color: {theme.top_panel_active_item_bg}!important;
331+ }}
332+ #odooMenuBarNav > div > div.o_sub_menu_content > ul > li > a.active{{
333+ background-color: {theme.top_panel_active_item_bg}!important;
334+ }}"""
335+ )
336+ if self .top_panel_active_subitem_bg_active :
337+ code = (
338+ code
339+ + """#odooMenuBarNav > div > div.o_sub_menu_content > ul > li > ul > li.active > a{{
340+ background-color: {theme.top_panel_active_subitem_bg}!important;
313341 }}"""
314342 )
315343 if self .top_panel_hover_item_font_active :
@@ -348,31 +376,22 @@ def _compute_less(self):
348376 """
349377 )
350378 if self .top_panel_hover_item_bg_active :
379+ # Compatibility theme_kit and material backend theme modules
351380 code = (
352381 code
353- + """.o_main_navbar > ul > li > a:hover{{
354- background-color: {theme.top_panel_hover_item_bg}!important;
355- }}
356- .o_main_navbar > ul > li > a:focus{{
357- background-color: {theme.top_panel_hover_item_bg}!important;
358- }}
359- .navbar-nav li a:hover{{
360- background-color: {theme.top_panel_hover_item_bg}!important;
361- }}
362- .navbar-nav li a:focus{{
363- background-color: {theme.top_panel_hover_item_bg}!important;
364- }}
365- .o_main_navbar > .o_menu_toggle:hover{{
366- background-color: {theme.top_panel_hover_item_bg}!important;
382+ + """#odooMenuBarNav > div > div.o_sub_menu_content > ul > li > a:hover{{
383+ background-color: {theme.top_panel_hover_item_bg} !important;
367384 }}
368- .o_main_navbar > .o_menu_toggle :focus{{
369- background-color: {theme.top_panel_hover_item_bg}!important;
385+ #odooMenuBarNav > div > div.o_sub_menu_content > ul > li > a :focus{{
386+ background-color: {theme.top_panel_hover_item_bg} !important;
370387 }}
371- .open .dropdown-menu > li a:hover {{
372- background-color: {theme.top_panel_hover_item_bg}!important;
373- }}
374- .open .dropdown-menu > li a:focus {{
375- background-color: {theme.top_panel_hover_item_bg}!important;
388+ """
389+ )
390+ if self .top_panel_hover_subitem_bg_active :
391+ code = (
392+ code
393+ + """#odooMenuBarNav > div > div.o_sub_menu_content > ul > li > ul > li > a:hover {{
394+ background: {theme.top_panel_hover_subitem_bg} !important;
376395 }}
377396 """
378397 )
@@ -624,6 +643,9 @@ def _compute_less(self):
624643 .o_mail_chat .o_mail_chat_sidebar .o_mail_chat_channel_item.o_active {{
625644 background-color: {theme.left_panel_active_item_bg}!important;
626645 }}
646+ #sidebar > li > a.active{{
647+ background-color: {theme.left_panel_active_item_bg}!important;
648+ }}
627649 """
628650 )
629651 if self .left_panel_hover_item_font_active :
0 commit comments