From ea91fd17d0f17196b4421209aa6c3a1ed560ec60 Mon Sep 17 00:00:00 2001 From: quyen Date: Tue, 13 Aug 2024 16:29:23 +0700 Subject: [PATCH] [IMP] to_backend_theme: change background image --- .../src/components/apps_menu/apps_menu.scss | 27 +++++- .../components/apps_menu/apps_menu_service.js | 19 +++++ .../apps_menu_item/apps_menu_item.scss | 6 +- .../menu_canonical_searchbar/searchbar.scss | 5 +- .../static/src/img/home-menu-bg-overlay.svg | 82 +++++++++++++++++++ 5 files changed, 131 insertions(+), 8 deletions(-) create mode 100644 to_backend_theme/static/src/components/apps_menu/apps_menu_service.js create mode 100644 to_backend_theme/static/src/img/home-menu-bg-overlay.svg diff --git a/to_backend_theme/static/src/components/apps_menu/apps_menu.scss b/to_backend_theme/static/src/components/apps_menu/apps_menu.scss index a0e812d6..97a110e6 100644 --- a/to_backend_theme/static/src/components/apps_menu/apps_menu.scss +++ b/to_backend_theme/static/src/components/apps_menu/apps_menu.scss @@ -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); +} diff --git a/to_backend_theme/static/src/components/apps_menu/apps_menu_service.js b/to_backend_theme/static/src/components/apps_menu/apps_menu_service.js new file mode 100644 index 00000000..565512c8 --- /dev/null +++ b/to_backend_theme/static/src/components/apps_menu/apps_menu_service.js @@ -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); + }) + }, +}); + + diff --git a/to_backend_theme/static/src/components/apps_menu_item/apps_menu_item.scss b/to_backend_theme/static/src/components/apps_menu_item/apps_menu_item.scss index fe5a8f4e..edc18374 100644 --- a/to_backend_theme/static/src/components/apps_menu_item/apps_menu_item.scss +++ b/to_backend_theme/static/src/components/apps_menu_item/apps_menu_item.scss @@ -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)}; } } diff --git a/to_backend_theme/static/src/components/menu_canonical_searchbar/searchbar.scss b/to_backend_theme/static/src/components/menu_canonical_searchbar/searchbar.scss index 4e1d888d..2b49c459 100644 --- a/to_backend_theme/static/src/components/menu_canonical_searchbar/searchbar.scss +++ b/to_backend_theme/static/src/components/menu_canonical_searchbar/searchbar.scss @@ -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; } } diff --git a/to_backend_theme/static/src/img/home-menu-bg-overlay.svg b/to_backend_theme/static/src/img/home-menu-bg-overlay.svg new file mode 100644 index 00000000..620ed752 --- /dev/null +++ b/to_backend_theme/static/src/img/home-menu-bg-overlay.svg @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +