@@ -104,6 +104,14 @@ class ThemeTopPanel(models.Model):
104
104
default = False , help = "Active item Background color for Top Panel"
105
105
)
106
106
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
+
107
115
top_panel_hover_item_font = fields .Char (
108
116
"Hover item Font color" , help = "Hover item Font color for Top Panel"
109
117
)
@@ -117,6 +125,12 @@ class ThemeTopPanel(models.Model):
117
125
top_panel_hover_item_bg_active = fields .Boolean (
118
126
default = False , help = "Hover item Background color for Top Panel"
119
127
)
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
+ )
120
134
121
135
# Compatibility theme_kit and material backend theme modules
122
136
left_panel_main_menu = fields .Char (
@@ -163,10 +177,14 @@ def write(self, vals):
163
177
self .top_panel_hover_item_font = ""
164
178
if not vals .get ("top_panel_hover_item_bg_active" , "Not found" ):
165
179
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 = ""
166
182
if not vals .get ("left_panel_main_menu_active" , "Not found" ):
167
183
self .left_panel_main_menu = ""
168
184
if not vals .get ("left_panel_sub_menu_active" , "Not found" ):
169
185
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 = ""
170
188
171
189
@api .multi
172
190
def _compute_less (self ):
@@ -309,6 +327,16 @@ def _compute_less(self):
309
327
code
310
328
+ """.navbar-nav .active a{{
311
329
background-color: {theme.top_panel_active_item_bg}!important;
330
+ }}
331
+ #odooMenuBarNav > div > div.o_sub_menu_content > ul > li > a.active{{
332
+ background-color: {theme.top_panel_active_item_bg}!important;
333
+ }}"""
334
+ )
335
+ if self .top_panel_active_subitem_bg_active :
336
+ code = (
337
+ code
338
+ + """#odooMenuBarNav > div > div.o_sub_menu_content > ul > li > ul > li.active > a{{
339
+ background-color: {theme.top_panel_active_subitem_bg}!important;
312
340
}}"""
313
341
)
314
342
if self .top_panel_hover_item_font_active :
@@ -347,31 +375,22 @@ def _compute_less(self):
347
375
"""
348
376
)
349
377
if self .top_panel_hover_item_bg_active :
378
+ # Compatibility theme_kit and material backend theme modules
350
379
code = (
351
380
code
352
- + """.o_main_navbar > ul > li > a:hover{{
353
- background-color: {theme.top_panel_hover_item_bg}!important;
354
- }}
355
- .o_main_navbar > ul > li > a:focus{{
356
- background-color: {theme.top_panel_hover_item_bg}!important;
357
- }}
358
- .navbar-nav li a:hover{{
359
- background-color: {theme.top_panel_hover_item_bg}!important;
360
- }}
361
- .navbar-nav li a:focus{{
362
- background-color: {theme.top_panel_hover_item_bg}!important;
363
- }}
364
- .o_main_navbar > .o_menu_toggle:hover{{
365
- background-color: {theme.top_panel_hover_item_bg}!important;
381
+ + """#odooMenuBarNav > div > div.o_sub_menu_content > ul > li > a:hover{{
382
+ background-color: {theme.top_panel_hover_item_bg} !important;
366
383
}}
367
- .o_main_navbar > .o_menu_toggle :focus{{
368
- background-color: {theme.top_panel_hover_item_bg}!important;
384
+ #odooMenuBarNav > div > div.o_sub_menu_content > ul > li > a :focus{{
385
+ background-color: {theme.top_panel_hover_item_bg} !important;
369
386
}}
370
- .open .dropdown-menu > li a:hover {{
371
- background-color: {theme.top_panel_hover_item_bg}!important;
372
- }}
373
- .open .dropdown-menu > li a:focus {{
374
- background-color: {theme.top_panel_hover_item_bg}!important;
387
+ """
388
+ )
389
+ if self .top_panel_hover_subitem_bg_active :
390
+ code = (
391
+ code
392
+ + """#odooMenuBarNav > div > div.o_sub_menu_content > ul > li > ul > li > a:hover {{
393
+ background: {theme.top_panel_hover_subitem_bg} !important;
375
394
}}
376
395
"""
377
396
)
@@ -614,13 +633,13 @@ def _compute_less(self):
614
633
if self .left_panel_active_item_bg_active :
615
634
code = (
616
635
code
617
- + """.o_sub_menu .oe_secondary_submenu .active a {{
636
+ + """.o_sub_menu .oe_secondary_submenu a:focus {{
618
637
background-color: {theme.left_panel_active_item_bg}!important;
619
638
}}
620
- .o_sub_menu .oe_secondary_submenu a:focus {{
639
+ .o_mail_chat .o_mail_chat_sidebar .o_mail_chat_channel_item.o_active {{
621
640
background-color: {theme.left_panel_active_item_bg}!important;
622
641
}}
623
- .o_mail_chat .o_mail_chat_sidebar .o_mail_chat_channel_item.o_active {{
642
+ #sidebar > li > a.active {{
624
643
background-color: {theme.left_panel_active_item_bg}!important;
625
644
}}
626
645
"""
0 commit comments