@@ -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 ):
@@ -310,6 +328,16 @@ def _compute_less(self):
310
328
code
311
329
+ """.navbar-nav .active a{{
312
330
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;
313
341
}}"""
314
342
)
315
343
if self .top_panel_hover_item_font_active :
@@ -348,31 +376,22 @@ def _compute_less(self):
348
376
"""
349
377
)
350
378
if self .top_panel_hover_item_bg_active :
379
+ # Compatibility theme_kit and material backend theme modules
351
380
code = (
352
381
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;
367
384
}}
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;
370
387
}}
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;
376
395
}}
377
396
"""
378
397
)
@@ -624,6 +643,9 @@ def _compute_less(self):
624
643
.o_mail_chat .o_mail_chat_sidebar .o_mail_chat_channel_item.o_active {{
625
644
background-color: {theme.left_panel_active_item_bg}!important;
626
645
}}
646
+ #sidebar > li > a.active{{
647
+ background-color: {theme.left_panel_active_item_bg}!important;
648
+ }}
627
649
"""
628
650
)
629
651
if self .left_panel_hover_item_font_active :
0 commit comments