Files
odoo_source/addons/website/views/snippets/s_hr.xml
T
fb20b16d48 [FIX] web_editor, *: review icon buttons sizing and paddings
*: mass_mailing, website, website_sale

Before this commit, it was impossible to add `fa-fw` directly on a
`we-button` as it would make the icon half invisible, since the whole
`we-button` would have the font-awesome `.fa-fw` css rule applied on it;
width: ~1.28em.

Then, one would need to insert a `<i/>` tag inside the `we-button` for
it to work.

This commit improves that behavior by handling automatically such cases,
and will preserve the purpose of the `fa-fw` class which is to have a
fixed width for those icons.

Note that the util class introduced in [1] (o_we_button_icon renamed
here in o_we_icon_button) is still useful to handle the case of svg
images, they are not allowed to shrink, the same way the fa buttons are.

[1]: https://github.com/odoo/odoo/commit/e4233643b93b521454cc146c6a2ae876781fb9ba

Related to task-2172311

closes odoo/odoo#77980

X-original-commit: e8ab9d76b802e80bb386812e4c8566825cbc2c92
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Younn Olivier <yol@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-10-07 13:09:26 +00:00

39 lines
1.6 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="s_hr" name="Separator">
<div class="s_hr text-left pt32 pb32">
<hr class="w-100 mx-auto" style="border-top-width: 1px; border-top-style: solid;"/>
</div>
</template>
<template id="s_hr_options" inherit_id="website.snippet_options">
<xpath expr="." position="inside">
<div data-selector=".s_hr" data-target="hr">
<t t-call="website.snippet_options_border_line_widgets">
<t t-set="label">Border</t>
<t t-set="direction" t-value="'top'"/>
</t>
<we-select string="Width">
<we-button data-select-class="w-25">25%</we-button>
<we-button data-select-class="w-50">50%</we-button>
<we-button data-select-class="w-75">75%</we-button>
<we-button data-select-class="w-100" data-name="so_width_100">100%</we-button>
</we-select>
<we-button-group string="Alignment" data-dependencies="!so_width_100">
<we-button class="fa fa-fw fa-align-left" title="Left" data-select-class="mr-auto"/>
<we-button class="fa fa-fw fa-align-center" title="Center" data-select-class="mx-auto"/>
<we-button class="fa fa-fw fa-align-right" title="Right" data-select-class="ml-auto"/>
</we-button-group>
</div>
</xpath>
</template>
<record id="website.s_hr_000_scss" model="ir.asset">
<field name="name">Hr 000 SCSS</field>
<field name="bundle">web.assets_frontend</field>
<field name="path">website/static/src/snippets/s_hr/000.scss</field>
</record>
</odoo>