Skip to content

Commit 5f07142

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. Task: 5344000 X-original-commit: 86b6138
1 parent ffde13a commit 5f07142

File tree

3 files changed

+146
-169
lines changed

3 files changed

+146
-169
lines changed

src/components/side_panel/conditional_formatting/cf_preview/cf_preview.css

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
display: none;
1818
}
1919
.o-cf-preview-icon {
20-
position: absolute;
2120
height: 50px;
2221
width: 50px;
2322
.o-icon {
@@ -26,12 +25,6 @@
2625
}
2726
}
2827
.o-cf-preview-description {
29-
left: 65px;
30-
margin-bottom: auto;
31-
margin-right: 8px;
32-
margin-top: auto;
33-
position: relative;
34-
width: 142px;
3528
.o-cf-preview-description-rule {
3629
margin-bottom: 4px;
3730
max-height: 2.8em;
@@ -41,16 +34,11 @@
4134
font-size: 12px;
4235
}
4336
}
44-
.o-cf-delete {
45-
left: 90%;
46-
top: 39%;
47-
position: absolute;
48-
}
4937
&:not(:hover):not(.o-cf-dragging) .o-cf-drag-handle {
5038
display: none !important;
5139
}
5240
.o-cf-drag-handle {
53-
left: -8px;
41+
left: 2px;
5442
cursor: move;
5543
.o-icon {
5644
width: 6px;

src/components/side_panel/conditional_formatting/cf_preview/cf_preview.xml

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,45 @@
22
<t t-name="o-spreadsheet-ConditionalFormatPreview">
33
<t t-set="cf" t-value="props.conditionalFormat"/>
44
<div
5-
class="o-cf-preview w-100 border-bottom"
5+
class="o-cf-preview w-100 d-flex align-items-center border-bottom"
66
t-ref="cfPreview"
77
t-att-class="props.class"
88
t-att-data-id="cf.id"
99
t-on-click="props.onPreviewClick"
1010
t-on-pointerdown="(ev) => this.onMouseDown(ev)">
11-
<div class="position-relative h-100 w-100 d-flex align-items-center">
11+
<div class="o-cf-drag-handle h-100 position-absolute d-flex align-items-center o-button-icon">
12+
<t t-call="o-spreadsheet-Icon.THIN_DRAG_HANDLE"/>
13+
</div>
14+
<t t-if="cf.rule.type==='IconSetRule'">
1215
<div
13-
class="o-cf-drag-handle h-100 position-absolute d-flex align-items-center o-button-icon">
14-
<t t-call="o-spreadsheet-Icon.THIN_DRAG_HANDLE"/>
16+
class="o-cf-preview-icon d-flex justify-content-around align-items-center me-3 bg-white border">
17+
<t t-call="o-spreadsheet-Icon.{{icons[cf.rule.icons.upper].template}}"/>
18+
<t t-call="o-spreadsheet-Icon.{{icons[cf.rule.icons.middle].template}}"/>
19+
<t t-call="o-spreadsheet-Icon.{{icons[cf.rule.icons.lower].template}}"/>
1520
</div>
16-
<t t-if="cf.rule.type==='IconSetRule'">
17-
<div
18-
class="o-cf-preview-icon d-flex justify-content-around align-items-center me-2 bg-white border">
19-
<t t-call="o-spreadsheet-Icon.{{icons[cf.rule.icons.upper].template}}"/>
20-
<t t-call="o-spreadsheet-Icon.{{icons[cf.rule.icons.middle].template}}"/>
21-
<t t-call="o-spreadsheet-Icon.{{icons[cf.rule.icons.lower].template}}"/>
22-
</div>
23-
</t>
24-
<t t-else="">
25-
<div
26-
t-att-style="getPreviewImageStyle(cf.rule)"
27-
class="o-cf-preview-icon d-flex justify-content-around align-items-center me-2 border">
28-
123
29-
</div>
30-
</t>
31-
<div class="o-cf-preview-description">
32-
<div class="o-cf-preview-ruletype">
33-
<div class="o-cf-preview-description-rule o-fw-bold text-truncate">
34-
<t t-esc="getDescription(cf)"/>
35-
</div>
36-
</div>
37-
<div class="o-cf-preview-range text-truncate" t-esc="cf.ranges"/>
21+
</t>
22+
<t t-else="">
23+
<div
24+
t-att-style="getPreviewImageStyle(cf.rule)"
25+
class="o-cf-preview-icon d-flex justify-content-around align-items-center me-3 flex-shrink-0 border">
26+
123
3827
</div>
39-
<div class="o-cf-delete">
40-
<div
41-
class="o-cf-delete-button o-button-icon"
42-
t-on-click.stop="(ev) => this.deleteConditionalFormat(cf, ev)"
43-
title="Remove rule">
44-
<t t-call="o-spreadsheet-Icon.TRASH_FILLED"/>
28+
</t>
29+
<div class="o-cf-preview-description me-3 overflow-auto">
30+
<div class="o-cf-preview-ruletype">
31+
<div class="o-cf-preview-description-rule o-fw-bold text-truncate">
32+
<t t-esc="getDescription(cf)"/>
4533
</div>
4634
</div>
35+
<div class="o-cf-preview-range text-truncate" t-esc="cf.ranges"/>
36+
</div>
37+
<div class="o-cf-delete ms-auto">
38+
<div
39+
class="o-cf-delete-button o-button-icon"
40+
t-on-click.stop="(ev) => this.deleteConditionalFormat(cf, ev)"
41+
title="Remove rule">
42+
<t t-call="o-spreadsheet-Icon.TRASH_FILLED"/>
43+
</div>
4744
</div>
4845
</div>
4946
</t>

0 commit comments

Comments
 (0)