From 998e40cf0722ea8e11408617849a4ab4ef592d02 Mon Sep 17 00:00:00 2001 From: mano-odoo Date: Tue, 7 Nov 2023 14:46:05 +0100 Subject: [PATCH] [FIX] web, project: list renderer alignment top Prior to this commit some td in the list renderer were vertically align on the middle while other are aligned on top. This comes from commit[1] This commit removes the vertical-align: middle to rely on the inherited alignment from the `` which is inherited until the `` el which set the alignment on `top`. To visually center the icons previously centered by vertical-align, a new variable: `$o-line-size` is created. This variable accounts for the total size of a line which is the font size multiplied by the line height. In our case this ensure that the icons line height in the list view is the same as the
that are containing text. [1]: odoo/odoo@53f605399755f9355554c2582ea0f693c8f947b4 task-3557566 closes odoo/odoo#145290 X-original-commit: cce036d03ccd7c12f34ed930b8964e26464732ba Related: odoo/enterprise#52275 Signed-off-by: Pierre Paridans (app) --- .../project_task_state_selection.scss | 2 ++ addons/web/static/src/scss/secondary_variables.scss | 4 ++++ addons/web/static/src/views/list/list_renderer.scss | 5 ++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/addons/project/static/src/components/project_task_state_selection/project_task_state_selection.scss b/addons/project/static/src/components/project_task_state_selection/project_task_state_selection.scss index ed237603c96..adf6eaf92d3 100644 --- a/addons/project/static/src/components/project_task_state_selection/project_task_state_selection.scss +++ b/addons/project/static/src/components/project_task_state_selection/project_task_state_selection.scss @@ -19,6 +19,8 @@ } .o_task_state_list_view { + height: $o-line-size; + .fa-lg { font-size: 1.315em; vertical-align: -6%; diff --git a/addons/web/static/src/scss/secondary_variables.scss b/addons/web/static/src/scss/secondary_variables.scss index be18c69584c..5ef2650bca1 100644 --- a/addons/web/static/src/scss/secondary_variables.scss +++ b/addons/web/static/src/scss/secondary_variables.scss @@ -30,6 +30,10 @@ $o-statusbar-disabled-bg: lighten($o-brand-lightsecondary, 7%) !default; $o-datepicker-week-bg-color: lighten($o-datepicker-week-color, 30%) !default; +// Computation of the total height of a single line, +// useful to visually center elements eg. in a list view. +$o-line-size: $o-line-height-base * $o-font-size-base !default; + // Form // Safest for the next value would be map-get($container-max-widths, lg) as it diff --git a/addons/web/static/src/views/list/list_renderer.scss b/addons/web/static/src/views/list/list_renderer.scss index ba8fa1648c0..df18ecb6d2b 100644 --- a/addons/web/static/src/views/list/list_renderer.scss +++ b/addons/web/static/src/views/list/list_renderer.scss @@ -78,7 +78,10 @@ display: table-cell; @include text-truncate(); - vertical-align: middle; + + .o_field_priority .fa, .o_field_list_activity .fa { + line-height: $o-line-size; + } &.o_list_text { white-space: pre-wrap;