From 244571b4b463e838202ca62198fb2e7d4bf39cc2 Mon Sep 17 00:00:00 2001 From: "stefanorigano (SRI)" Date: Thu, 23 Dec 2021 13:41:18 +0000 Subject: [PATCH] [FIX] web: debug profiling menu design This commit fixes the profiling menu item design, simplify the css and removes several lines of vendor-prefix animations no longer necessary. This commit is part of v16 overall restyle (task-2704984). task-2712151 Part-of: odoo/odoo#82434 --- .../core/debug/profiling/profiling_item.scss | 32 ++-- .../core/debug/profiling/profiling_item.xml | 92 +++++----- .../core/debug/profiling/profiling_service.js | 6 +- .../web/static/src/legacy/scss/animation.scss | 160 ++++-------------- 4 files changed, 96 insertions(+), 194 deletions(-) diff --git a/addons/web/static/src/core/debug/profiling/profiling_item.scss b/addons/web/static/src/core/debug/profiling/profiling_item.scss index 8644c3e1e5e..b0a28c5ef2d 100644 --- a/addons/web/static/src/core/debug/profiling/profiling_item.scss +++ b/addons/web/static/src/core/debug/profiling/profiling_item.scss @@ -1,25 +1,17 @@ -.o_debug_profiling_item { - .o_profiling_switch { - padding-top: 3px; - padding-bottom: 3px; - .custom-switch { - display: inline-block; - } - .custom-control-label { - cursor: pointer; - } - .o_open_profiling { - padding-top: 3px; - } +.o_debug_manager { + .dropdown-menu .o_debug_profiling_item_wrapper.dropdown-item.focus { + background: inherit; + } + + .o_debug_profiling_item { + cursor: auto; + } + + .custom-switch { + cursor: pointer; } -} -.o_debug_manager .fa-bug { - position: relative; .o_recording { - position: absolute; - bottom: -0.1em; - right: -0.4em; - font-size: 0.8em; + animation: 2s flash infinite; } } diff --git a/addons/web/static/src/core/debug/profiling/profiling_item.xml b/addons/web/static/src/core/debug/profiling/profiling_item.xml index d8c64358da1..3ff67c61101 100644 --- a/addons/web/static/src/core/debug/profiling/profiling_item.xml +++ b/addons/web/static/src/core/debug/profiling/profiling_item.xml @@ -2,53 +2,55 @@ - -
- - - - + +
+
+
Recording...
+ + + + + - - - - - - - - - - - -
-
-
Interval
+ + + + + + + + + +
+
+
Interval
+
+
- -
- - - - - - - - - + + + + + + + + + +
+ + +
diff --git a/addons/web/static/src/core/debug/profiling/profiling_service.js b/addons/web/static/src/core/debug/profiling/profiling_service.js index e0ee28ab286..2298e6cd469 100644 --- a/addons/web/static/src/core/debug/profiling/profiling_service.js +++ b/addons/web/static/src/core/debug/profiling/profiling_service.js @@ -21,10 +21,10 @@ const profilingService = { let recordingIcon = null; function updateDebugIcon() { - const debugItem = document.querySelector(".o_main_navbar .o_debug_manager .fa-bug"); + const debugItem = document.querySelector(".o_debug_manager .dropdown-toggle"); if (state.isEnabled) { - recordingIcon = document.createElement("span"); - recordingIcon.classList.add("o_recording", "text-danger", "fa", "fa-circle"); + recordingIcon = document.createElement("i"); + recordingIcon.classList.add("o_recording", "badge", "badge-pill", "d-inline", "p-2", "bg-danger", "border"); debugItem.appendChild(recordingIcon); } else if (recordingIcon) { debugItem.removeChild(recordingIcon); diff --git a/addons/web/static/src/legacy/scss/animation.scss b/addons/web/static/src/legacy/scss/animation.scss index d65a509bcad..9a410103045 100644 --- a/addons/web/static/src/legacy/scss/animation.scss +++ b/addons/web/static/src/legacy/scss/animation.scss @@ -15,132 +15,40 @@ } } -@-moz-keyframes markAnim { - 0% { - opacity: 0; - -moz-transform: scaleX(0.50) scaleY(0.50); - } - 30% { - opacity: 1; - -moz-transform: scaleX(1.00) scaleY(1.00); - } - 100% { - opacity: 0; - -moz-transform: scaleX(1.00) scaleY(1.00); - } -} - -@-webkit-keyframes markAnim { - 0% { - opacity: 0; - -webkit-transform: scaleX(0.50) scaleY(0.50); - } - 30% { - opacity: 1; - -webkit-transform: scaleX(1.00) scaleY(1.00); - } - 100% { - opacity: 0; - -webkit-transform: scaleX(1.00) scaleY(1.00); - } -} - -@-o-keyframes markAnim { - 0% { - opacity: 0; - -o-transform: scaleX(0.50) scaleY(0.50); - } - 30% { - opacity: 1; - -o-transform: scaleX(1.00) scaleY(1.00); - } - 100% { - opacity: 0; - -o-transform: scaleX(1.00) scaleY(1.00); - } -} - -@-ms-keyframes markAnim { - 0% { - opacity: 0; - -ms-transform: scaleX(0.50) scaleY(0.50); - } - 30% { - opacity: 1; - -ms-transform: scaleX(1.00) scaleY(1.00); - } - 100% { - opacity: 0; - -ms-transform: scaleX(1.00) scaleY(1.00); - } -} - // 'bounce' effect -@-webkit-keyframes bounceIn { - 0%, 20%, 40%, 60%, 80%, 100% { - -webkit-transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); - transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); - } - - 0% { - opacity: 0; - -webkit-transform: scale3d(.3, .3, .3); - transform: scale3d(.3, .3, .3); - } - 20% { - -webkit-transform: scale3d(1.1, 1.1, 1.1); - transform: scale3d(1.1, 1.1, 1.1); - } - 40% { - -webkit-transform: scale3d(.9, .9, .9); - transform: scale3d(.9, .9, .9); - } - 60% { - opacity: 1; - -webkit-transform: scale3d(1.03, 1.03, 1.03); - transform: scale3d(1.03, 1.03, 1.03); - } - 80% { - -webkit-transform: scale3d(.97, .97, .97); - transform: scale3d(.97, .97, .97); - } - 100% { - opacity: 1; - -webkit-transform: scale3d(1, 1, 1); - transform: scale3d(1, 1, 1); - } -} - @keyframes bounceIn { - 0%, 20%, 40%, 60%, 80%, 100% { - -webkit-transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); - transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); - } - 0% { - opacity: 0; - -webkit-transform: scale3d(.3, .3, .3); - transform: scale3d(.3, .3, .3); - } - 20% { - -webkit-transform: scale3d(1.1, 1.1, 1.1); - transform: scale3d(1.1, 1.1, 1.1); - } - 40% { - -webkit-transform: scale3d(.9, .9, .9); - transform: scale3d(.9, .9, .9); - } - 60% { - opacity: 1; - -webkit-transform: scale3d(1.03, 1.03, 1.03); - transform: scale3d(1.03, 1.03, 1.03); - } - 80% { - -webkit-transform: scale3d(.97, .97, .97); - transform: scale3d(.97, .97, .97); - } - 100% { - opacity: 1; - -webkit-transform: scale3d(1, 1, 1); - transform: scale3d(1, 1, 1); - } + 0%, 20%, 40%, 60%, 80%, 100% { + transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); + } + 0% { + opacity: 0; + transform: scale3d(.3, .3, .3); + } + 20% { + transform: scale3d(1.1, 1.1, 1.1); + } + 40% { + transform: scale3d(.9, .9, .9); + } + 60% { + opacity: 1; + transform: scale3d(1.03, 1.03, 1.03); + } + 80% { + transform: scale3d(.97, .97, .97); + } + 100% { + opacity: 1; + transform: scale3d(1, 1, 1); + } +} + +@keyframes flash { + from, 50%, to { + opacity: 1; + } + + 25%, 75% { + opacity: 0; + } }