[FIX] web: oe_title + oe_avatar alignment in Form view

This commit fixes a broken selector when an avatar image (`.oe_avatar`)
is used next to a title element (`.oe_title`) to put them side-by-side.

Also it goes beyond that by ensuring the `.oe_title` element doesn't
take the whole width (cf. max 75%) to make a visual distinction between
it and the other form's fields, both in editable and non-editable form.

In small screen, as space is limited, the whole width is kept to make it
more userfriendly, only allowing a thin gap between the `.oe_title` and
the `.oe_avatar`.

Steps to reproduce:
- Open Apps
- Choose an App and, in the dropdown, click on Module Info
=> there is a huge gap at the top of the title

closes odoo/odoo#112205

X-original-commit: 45ebcbf320eaeedf0a4c6c068ea727cf18bedd4b
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
This commit is contained in:
Pierre Paridans
2023-02-08 15:39:03 +01:00
parent 0071b8479c
commit 4ce90e196d
@@ -173,8 +173,6 @@
}
.oe_title {
max-width: 75%;
.o_field_char {
width: 100%;
}
@@ -368,9 +366,11 @@
// Title
.oe_title {
color: $headings-color;
@include media-breakpoint-up(vsm, $o-extra-grid-breakpoints) {
padding-right: $o-innergroup-rpadding;
@include media-breakpoint-up(sm) {
max-width: 75%;
}
> h1, > h2, > h3 {
width: 100%; // Needed because inline-block when is a hx.o_row
margin-top: 0;
@@ -390,9 +390,6 @@
> h2 {
min-height: 42px;
}
.oe_avatar + & {
padding-right: $o-avatar-size + 10;
}
}
// Avatar
@@ -400,12 +397,18 @@
float: right;
margin-bottom: 10px;
> div > img {
.img {
max-width: $o-avatar-size;
max-height: $o-avatar-size;
vertical-align: top;
border: 1px solid $o-gray-300;
}
@include media-breakpoint-down(sm) {
+ .oe_title {
max-width: calc(100% - #{$o-avatar-size} - #{map-get($spacers, 2)});
}
}
}
// Status dropdown