From 5afd20a530f53a8da14778673468980312333518 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Thu, 19 Apr 2012 17:33:41 +0200 Subject: [PATCH] [IMP] Improved rendering engine group cells width computing bzr revid: fme@openerp.com-20120419153341-gequ3826z6fd44x6 --- addons/web/static/src/css/base.css | 5 ++++- addons/web/static/src/css/base.sass | 4 +++- addons/web/static/src/js/view_form.js | 15 ++++++++++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 854946cdf97..2b90d47c002 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1783,11 +1783,14 @@ font-weight: bold; } .openerp .oe_layout_debugging .oe_form_group { - outline: 2px dashed red; + outline: 2px dashed green; } .openerp .oe_layout_debugging .oe_form_group_cell { outline: 1px solid blue; } +.openerp .oe_layout_debugging .oe_form_group:hover, .openerp .oe_layout_debugging .oe_form_group_cell:hover { + outline-color: red; +} .openerp .oe_debug_view { float: left; } diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 98caeafbb29..fc645a92e44 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1490,9 +1490,11 @@ $colour4: #8a89ba // Debugging stuff {{{ .oe_layout_debugging .oe_form_group - outline: 2px dashed red + outline: 2px dashed green .oe_form_group_cell outline: 1px solid blue + .oe_form_group:hover, .oe_form_group_cell:hover + outline-color: red .oe_debug_view float: left diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index a87982fdabd..c13e283354c 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -1119,7 +1119,20 @@ instance.web.form.FormRenderingEngine = instance.web.Class.extend({ } break; default: - to_compute.push($td); + var width = _.str.trim($child.attr('width') || ''), + iwidth = parseInt(width, 10); + if (iwidth) { + if (width.substr(-1) === '%') { + total -= iwidth; + width = iwidth + '%'; + } + $td.attr('width', width); + $child.removeAttr('width'); + row_cols--; + } else { + to_compute.push($td); + } + } }); var unit = Math.floor(total / row_cols);