Skip to content

Commit 1d65cff

Browse files
committed
[IMP] html_builder: change bring up/down icons
This commit adds new icons Odoo UI icons for the send to back/bring to front functionality. + other new Odoo UI icons for task-5061915 task-5173190
1 parent 5fafd0e commit 1d65cff

File tree

6 files changed

+12
-27
lines changed

6 files changed

+12
-27
lines changed

addons/html_builder/static/src/core/grid_layout/grid_layout_plugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,12 @@ export class GridLayoutPlugin extends Plugin {
100100
if (!this.config.isMobileView(this.overlayTarget)) {
101101
buttons.push(
102102
{
103-
class: "o_send_back oi",
103+
class: "oi-move-down oi",
104104
title: _t("Send to back"),
105105
handler: this.sendGridItemToBack.bind(this),
106106
},
107107
{
108-
class: "o_bring_front oi",
108+
class: "oi-move-up oi",
109109
title: _t("Bring to front"),
110110
handler: this.bringGridItemToFront.bind(this),
111111
}

addons/html_builder/static/src/core/overlay_buttons/overlay_buttons.scss

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,4 @@
1111
button.o_move_handle {
1212
cursor: move;
1313
}
14-
15-
button.o_send_back, button.o_bring_front {
16-
background-position: center;
17-
background-repeat: no-repeat;
18-
19-
&::before {
20-
// Hack to give a width to the buttons and apply paddings.
21-
content: "\00a0\00a0\00a0";
22-
}
23-
}
24-
25-
button.o_send_back {
26-
background-image: url('/html_builder/static/img/options/bring-backward.svg');
27-
}
28-
29-
button.o_bring_front {
30-
background-image: url('/html_builder/static/img/options/bring-forward.svg');
31-
}
3214
}
840 Bytes
Binary file not shown.
656 Bytes
Binary file not shown.

addons/web/static/lib/odoo_ui_icons/style.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@
9292
.oi-google-play:before { content: '\e81d'; }
9393
.oi-strava:before { content: '\e80f'; }
9494
.oi-discord:before { content: '\e811'; }
95+
.oi-move-up:before { content: '\e84c'; }
96+
.oi-move-down:before { content: '\e84d'; }
97+
.oi-life-ring-plus:before { content: '\e849'; }
9598

9699
/* RTL adaptations. */
97100
/* Flip directional icons by 180 degree. */

addons/website/static/tests/builder/overlay_buttons.test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ test("Use the 'grid' overlay buttons", async () => {
8383

8484
await contains(":iframe .g-col-lg-5").click();
8585
expect(".overlay .o_overlay_options").toHaveCount(1);
86-
expect(".overlay .o_send_back").toHaveCount(1);
87-
expect(".overlay .o_bring_front").toHaveCount(1);
86+
expect(".overlay .oi-move-down").toHaveCount(1);
87+
expect(".overlay .oi-move-up").toHaveCount(1);
8888

89-
await contains(".overlay .o_send_back").click();
89+
await contains(".overlay .oi-move-down").click();
9090
expect(":iframe .g-col-lg-5").toHaveStyle({ zIndex: "0" });
9191

92-
await contains(".overlay .o_bring_front").click();
92+
await contains(".overlay .oi-move-up").click();
9393
expect(":iframe .g-col-lg-5").toHaveStyle({ zIndex: "2" });
9494
});
9595

@@ -114,13 +114,13 @@ test("Refresh the overlay buttons when toggling the mobile preview", async () =>
114114

115115
await contains(":iframe .g-col-lg-4").click();
116116
await contains("[data-action='mobile']").click();
117-
expect(".overlay .o_send_back, .overlay .o_bring_front").toHaveCount(0);
117+
expect(".overlay .oi-move-down, .overlay .oi-move-up").toHaveCount(0);
118118
expect(".overlay .fa-angle-left").toHaveCount(1);
119119
expect(".overlay .fa-angle-right").toHaveCount(1);
120120

121121
await contains("[data-action='mobile']").click();
122-
expect(".overlay .o_send_back").toHaveCount(1);
123-
expect(".overlay .o_bring_front").toHaveCount(1);
122+
expect(".overlay .oi-move-down").toHaveCount(1);
123+
expect(".overlay .oi-move-up").toHaveCount(1);
124124
expect(".overlay .fa-angle-left, .overlay .fa-angle-right").toHaveCount(0);
125125
});
126126

0 commit comments

Comments
 (0)