Skip to content

Commit 5d0df51

Browse files
committed
[FIX] cf: conditional formatting preview is truncated for nothing
In the side panel, the preview of a conditional formatting rule is truncated at 142px, even if there is enough space to display it fully. closes #7492 Task: 5344000 Signed-off-by: Rémi Rahir (rar) <[email protected]>
1 parent ab9f15e commit 5d0df51

File tree

3 files changed

+154
-176
lines changed

3 files changed

+154
-176
lines changed

src/components/side_panel/conditional_formatting/cf_preview_list/cf_preview_list.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,10 @@ css/* scss */ `
3636
}
3737
.o-cf-preview-icon {
3838
border: 1px solid lightgrey;
39-
position: absolute;
4039
height: 50px;
4140
width: 50px;
4241
}
4342
.o-cf-preview-description {
44-
left: 65px;
45-
margin-bottom: auto;
46-
margin-right: 8px;
47-
margin-top: auto;
48-
position: relative;
49-
width: 142px;
5043
.o-cf-preview-description-rule {
5144
margin-bottom: 4px;
5245
font-weight: 600;
@@ -58,16 +51,11 @@ css/* scss */ `
5851
font-size: 12px;
5952
}
6053
}
61-
.o-cf-delete {
62-
left: 90%;
63-
top: 39%;
64-
position: absolute;
65-
}
6654
&:not(:hover):not(.o-cf-dragging) .o-cf-drag-handle {
6755
display: none !important;
6856
}
6957
.o-cf-drag-handle {
70-
left: -8px;
58+
left: 2px;
7159
cursor: move;
7260
.o-icon {
7361
width: 6px;

src/components/side_panel/conditional_formatting/cf_preview_list/cf_preview_list.xml

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -14,46 +14,44 @@
1414

1515
<t t-name="o-spreadsheet-ConditionalFormattingPanelPreview">
1616
<div
17-
class="o-cf-preview d-flex position-relative"
17+
class="o-cf-preview d-flex position-relative align-items-center"
1818
t-att-class="{ 'o-cf-dragging': dragAndDrop.draggedItemId === cf.id }"
1919
t-att-style="getPreviewDivStyle(cf)"
2020
t-att-data-id="cf.id"
2121
t-on-click="(ev) => props.onPreviewClick(cf)"
2222
t-on-mousedown="(ev) => this.onMouseDown(cf, ev)">
23-
<div class="position-relative h-100 w-100 d-flex align-items-center">
24-
<div class="o-cf-drag-handle h-100 position-absolute d-flex align-items-center text-muted">
25-
<t t-call="o-spreadsheet-Icon.THIN_DRAG_HANDLE"/>
23+
<div class="o-cf-drag-handle h-100 position-absolute d-flex align-items-center text-muted">
24+
<t t-call="o-spreadsheet-Icon.THIN_DRAG_HANDLE"/>
25+
</div>
26+
<t t-if="cf.rule.type==='IconSetRule'">
27+
<div class="o-cf-preview-icon d-flex justify-content-around align-items-center me-3">
28+
<t t-call="o-spreadsheet-Icon.{{icons[cf.rule.icons.upper].template}}"/>
29+
<t t-call="o-spreadsheet-Icon.{{icons[cf.rule.icons.middle].template}}"/>
30+
<t t-call="o-spreadsheet-Icon.{{icons[cf.rule.icons.lower].template}}"/>
2631
</div>
27-
<t t-if="cf.rule.type==='IconSetRule'">
28-
<div class="o-cf-preview-icon d-flex justify-content-around align-items-center me-2">
29-
<t t-call="o-spreadsheet-Icon.{{icons[cf.rule.icons.upper].template}}"/>
30-
<t t-call="o-spreadsheet-Icon.{{icons[cf.rule.icons.middle].template}}"/>
31-
<t t-call="o-spreadsheet-Icon.{{icons[cf.rule.icons.lower].template}}"/>
32-
</div>
33-
</t>
34-
<t t-else="">
35-
<div
36-
t-att-style="getPreviewImageStyle(cf.rule)"
37-
class="o-cf-preview-icon d-flex justify-content-around align-items-center me-2">
38-
123
39-
</div>
40-
</t>
41-
<div class="o-cf-preview-description">
42-
<div class="o-cf-preview-ruletype">
43-
<div class="o-cf-preview-description-rule text-truncate">
44-
<t t-esc="getDescription(cf)"/>
45-
</div>
46-
</div>
47-
<div class="o-cf-preview-range text-truncate" t-esc="cf.ranges"/>
32+
</t>
33+
<t t-else="">
34+
<div
35+
t-att-style="getPreviewImageStyle(cf.rule)"
36+
class="o-cf-preview-icon d-flex justify-content-around align-items-center me-3 flex-shrink-0">
37+
123
4838
</div>
49-
<div class="o-cf-delete">
50-
<div
51-
class="o-cf-delete-button text-muted"
52-
t-on-click.stop="(ev) => this.deleteConditionalFormat(cf, ev)"
53-
title="Remove rule">
54-
<t t-call="o-spreadsheet-Icon.TRASH"/>
39+
</t>
40+
<div class="o-cf-preview-description me-3 overflow-auto">
41+
<div class="o-cf-preview-ruletype">
42+
<div class="o-cf-preview-description-rule text-truncate">
43+
<t t-esc="getDescription(cf)"/>
5544
</div>
5645
</div>
46+
<div class="o-cf-preview-range text-truncate" t-esc="cf.ranges"/>
47+
</div>
48+
<div class="o-cf-delete ms-auto">
49+
<div
50+
class="o-cf-delete-button text-muted"
51+
t-on-click.stop="(ev) => this.deleteConditionalFormat(cf, ev)"
52+
title="Remove rule">
53+
<t t-call="o-spreadsheet-Icon.TRASH"/>
54+
</div>
5755
</div>
5856
</div>
5957
</t>

0 commit comments

Comments
 (0)