Skip to content

Commit

Permalink
[IMP] to_backend_theme: change background image
Browse files Browse the repository at this point in the history
  • Loading branch information
duyquyen96 committed Aug 14, 2024
1 parent 11c585f commit d61b9bc
Show file tree
Hide file tree
Showing 9 changed files with 144 additions and 11 deletions.
27 changes: 24 additions & 3 deletions to_backend_theme/static/src/components/apps_menu/apps_menu.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,31 @@
:root {
.o_grid_apps_menu[data-theme="viindoo"] {
.o_apps_menu_opened[data-theme="viindoo"] {
--app-menu-background: url("/to_backend_theme/static/src/img/home-menu-bg-overlay.svg")

}

.o_apps_menu_opened[data-theme="milk"] {
--app-menu-background: url("/web_responsive/static/src/img/home-menu-bg-overlay.svg"),
linear-gradient(
to bottom,
#{$app-menu-background-color},
#{desaturate(lighten($app-menu-background-color, 20%), 15)}
);
}

.o_apps_menu_opened[data-theme="community"] {
--app-menu-background: url("/web_responsive/static/src/img/home-menu-bg-overlay.svg"),
linear-gradient(
to bottom,
#{$brand-primary-dark},
#{desaturate(lighten($brand-primary-dark, 20%), 15)}
#{$o-brand-primary},
#{desaturate(lighten($o-brand-primary, 20%), 15)}
);
}
}
.app-menu-container {
background: none !important
}

.o_apps_menu_opened {
background: var(--app-menu-background);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<templates>
<t t-inherit="web.NavBar.AppsMenu" t-inherit-mode="extension">
<xpath expr="//Dropdown" position="attributes">
<attribute name="class">'o_navbar_apps_menu d-none'</attribute>
</xpath>
</t>
</templates>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/** @odoo-module **/

import { session } from "@web/session";
import { onMounted } from "@odoo/owl";
import { AppsMenuAction } from "@web_responsive/components/apps_menu/apps_menu_service";
import { patch } from "@web/core/utils/patch";


patch(AppsMenuAction.prototype, {
setup() {
super.setup();
onMounted(() => {
this.theme = session.apps_menu.theme || "viindoo";
document.body.setAttribute('data-theme', this.theme);
})
},
});


Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
:root {
.o_grid_apps_menu[data-theme="viindoo"] {
--app-menu-text-color: white;
--app-menu-text-shadow: 1px 1px 1px #{rgba(black, 0.4)};
--app-menu-hover-background: #{rgba(white, 0.2)};
--app-menu-text-color: "#374151";
// --app-menu-text-shadow: 1px 1px 1px #{rgba(black, 0.4)};
// --app-menu-hover-background: #{rgba(white, 0.2)};
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
:root {
.o_grid_apps_menu[data-theme="viindoo"] {
--apps-menu-scrollbar-background: white;
--apps-menu-empty-search-color: white;
--app-menu-text-color: #374151;
--apps-menu-scrollbar-background: #374151;
--apps-menu-empty-search-color: #374151;
}
}
82 changes: 82 additions & 0 deletions to_backend_theme/static/src/img/home-menu-bg-overlay.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions viin_brand_common/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
('after', 'web/static/src/views/fields/statusbar/statusbar_field.scss', 'viin_brand_common/static/src/views/fields/statusbar/statusbar_field.scss'),
('after', 'web/static/src/views/form/button_box/button_box.scss', 'viin_brand_common/static/src/views/form/button_box/button_box.scss'),
('after', 'web/static/src/webclient/webclient.js', 'viin_brand_common/static/src/webclient/webclient.js'),
('before', 'web/static/src/webclient/navbar/navbar.variables.scss', 'viin_brand_common/static/src/webclient/navbar/navbar_variables.scss'),
'viin_brand_common/static/src/webclient/navbar/navbar.scss',
'viin_brand_common/static/src/webclient/user_menu_item.js',
'viin_brand_common/static/src/views/widgets/**/*',
Expand Down
6 changes: 3 additions & 3 deletions viin_brand_common/static/src/legacy/scss/navbar.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.o_main_navbar {
background-color : $brand-primary-dark;
border-bottom: 1px solid $brand-primary-darker;
border-bottom: none !important;

.show {
.dropdown-toggle {
Expand Down Expand Up @@ -59,7 +58,8 @@ body.o_is_superuser .o_menu_systray {
.badge {
height: auto;
border-radius: 0.25rem;
background-color: var(--o-navbar-badge-bg, #{$o-enterprise-primary-color});
background-color: var(--o-navbar-badge-bg, $red);
color:white;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$o-navbar-entry-color: #374151 !default;
$o-navbar-background: none !default;

0 comments on commit d61b9bc

Please sign in to comment.