summaryrefslogtreecommitdiff
path: root/addons/web/static/src/xml
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2020-01-30 11:23:57 +0000
committerAaron Bohy <aab@odoo.com>2020-01-30 12:57:35 +0000
commit23490fc22fbd0174ace5558c9509b1bb856e03d2 (patch)
treed77067ef3be22c660451ec8684bdd70c8ddced85 /addons/web/static/src/xml
parentb0500b68585b87dcd6e07275fdafed8e50bc40f0 (diff)
[IMP] web: web_ribbon: handle longer labels
This commit implements a simple heuristic to display longer texts inside the web_ribbon widget: we adapt the font size according to the text length, and we tolerate to display it on several lines. This commit also allows to specify a tooltip in the xml (with tooltip attribute). Task 2185023 closes odoo/odoo#44279 Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Diffstat (limited to 'addons/web/static/src/xml')
-rw-r--r--addons/web/static/src/xml/ribbon.xml4
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/web/static/src/xml/ribbon.xml b/addons/web/static/src/xml/ribbon.xml
index d3248efa9ac..87df25d2145 100644
--- a/addons/web/static/src/xml/ribbon.xml
+++ b/addons/web/static/src/xml/ribbon.xml
@@ -3,7 +3,9 @@
<t t-name="web.ribbon">
<div class="ribbon ribbon-top-right">
- <span t-att-class="widget.bgColor ? widget.bgColor : 'bg-success'"><t t-esc="widget.text"/></span>
+ <span t-att-class="widget.className" t-att-title="widget.tooltip">
+ <t t-esc="widget.text"/>
+ </span>
</div>
</t>