odoo/o-spreadsheet#7455
Created by BI, Adrien Minne (adrm)
- label
- odoo:master-pivot-table-style-adrm
- head
- 63cb2701ec995d14b6a1d06b18f35b5d4e730c79
| odoo/o-spreadsheet | |
|---|---|
| master | #7455 missing r+ |
[IMP] pivots: implement pivot table styles
Description:
[IMP] pivots: implement pivot table styles
With this commit, we don't need to manually create a dynamic table
to a pivot to have a style applied. Instead we can add a style in the
pivot definition, and dynamic tables will automatically be created on
the dynamic pivot formulas.
Those new pivot styles are better than traditional tables styles because:
- they are directly linked to the pivot, taking into account the
number of headers, the presence of totals, etc.
- they are automatically added on =PIVOT() formulas, without the need to
create a dynamic table first.
- they are more powerful than the old table styles, they can have a
style for the sub-headers, the measure headers, etc.
[IMP] renderer: draw cell background over grid lines
With this commit, the cell background are now drawn totally covering
the grid lines. It's way prettier for table/pivots to have an uniform
background color without grid lines breaking it.
The downside is we cannot draw the hover overlay with a color alpha,
because it would overlap with the next cell, making a darker color
at the border. We can workaround by merging the colors programmatically
and avoid drawing with alpha.
[IMP] style: add skipCellGridLines style option
This commit introducing cell animations added an option
skipCellGridLines to the rendering boxes. The option allows to
skip drawing grid lines for specific cells.
This commit changes this rendering box option into a standard cell
style option, so it can be used in other parts of the codebase as well.
[REF] table style: add bold to table style presets
Before this commit, the table style presets contained all the style of
a table, except the bold property, which was handled separately and
applied to every total/header row or first/last column.
This made the code harder to read with two sources of truth for the
style, and with the introduction of pivot table styles, every header
row won't be in bold anymore.
This commit adds the bold property to the table style presets,
os it is handled like every other style property.
Task: 4552232
review checklist
- [ ] feature is organized in plugin, or UI components
- [ ] support of duplicate sheet (deep copy)
- [ ] in model/core: ranges are Range object, and can be adapted (adaptRanges)
- [ ] in model/UI: ranges are strings (to show the user)
- [ ] undo-able commands (uses this.history.update)
- [ ] multiuser-able commands (has inverse commands and transformations where needed)
- [ ] new/updated/removed commands are documented
- [ ] exportable in excel
- [ ] translations (_t("qmsdf %s", abc))
- [ ] unit tested
- [ ] clean commented code
- [ ] track breaking changes
- [ ] doc is rebuild (npm run doc)
- [ ] status is correct in Odoo