User:Andreschnabel/Spec Calc grid lines on colored background

From The Document Foundation Wiki
Jump to: navigation, search

Calc: option for grid lines on colored background


As reported in tdf#30800. Calc does not currently display grid lines on cells with a colored background. Suggestion is to have an option to enable the display of grid lines on cells with colored background.


  • User Experience
  • Quality Assurance
    • User:RBd Tests in Master when integrated


Current Situation

LibreOffice Calc does not currently display grid lines on cells with a colored background. This has bean introduced to give the same user experience as competing spreadsheet applications (read: Excel).


Gridlines display current.png

Target Situation

User should be able to enable grid line display on cells with colored background. For example:

Gridlines display new.png


The implementation change for the display does not need much elaboration, as it is straight forward (either display grid lines or not).

The option will be implemented as an application setting (stored in user settings / registry). Although some grid-related settings are stored in spreadsheet documents, such as Grid Color, the new setting will not be stored in the document.

Most discussion focuses on the "right place" for the option. We choose to implement the option as a view option (tri-state listbox)

Gridlines display option view lb.png

Reasons for that solution:

  • pro:
    • display option for gridlines on colored cell background is in the same place as the general grid line display option (easy to find by users looking for this option)
    • easy to implement (view options are already available in the drawing implementation ScGridWindow::Draw)
    • there is no need to remove other options
  • con:
    • a drop down hides the available settings; therefore, only the current value is visible in a drop down

UI definitions

Place to add new elements:

  • Option page in Tools > Options > Calc > View (see screenshot)

what needs to be added / changed

  • current checkbox "Grid Lines" will be replaced by a text label and a listbox

Strings, values and defaults

  • Text for text label: "~Grid lines" (same as for former checkbox)
  • Values for drop down:
    • "Show" Default value (grid lines displayed, unless a cell has a background color set)
    • "Show on colored cells" (grid lines displayed also on cells with background color set)
    • "Hide" (Grid lines are not displayed)

The default has been set to show to ease migration from Excel. Excel documents often use background colors to hide gridlines and implement some kind of "nice" on the screen form.

Tool tips and enhanced tool tips

  • currently non of the options has a tool tip
  • current enhanced tool tip is not displayed, as a wrong HID is used, see
    • current text is
  <ahelp hid="SC_CHECKBOX_RID_SCPAGE_CONTENT_CB_GRID">Specifies whether to display grid lines between the cells.</ahelp>
  • The drop down should get a new enhanced tool tip to explain what the options are for
    • help-id is sc:ListBox:RID_SCPAGE_CONTENT:LB_GRID
    • suggested text is: "Specifies when grid lines will be displayed. Default is to display grid lines only on cells that do not have a background color. You can choose to also display grid lines on cells with background color, or to hide them."

Help texts

  • help strings to change
    • Description at the view options page (shared/optionen/01060100.xhp
"For printing, choose <emph>Format - Page - </emph><link href="text/scalc/01/05070500.xhp" name="Sheet"><emph>Sheet</emph></link> and mark the <emph>Grid</emph> check box." Note:there is a <switchinline select="appl"> condition in current help - this is useless, as the page is displayed in calc only anyway
  • help on hiding grid lines (scalc/guide/table_view.xhp
"Under the menu item <emph><switchinline select="sys"><caseinline select="MAC">%PRODUCTNAME - Preferences</caseinline><defaultinline>Tools - Options</defaultinline></switchinline> - %PRODUCTNAME Calc</emph><emph>,</emph> go to the <emph>View</emph> tab page. Choose to hide <emph>Grid lines</emph> from the drop-down. Confirm with <emph>OK</emph>."

open questions / tasks

  • test automation needs to be changed?

alternative solutions

Some other ideas have that have been discussed but were not implemented.

as view option (additional checkbox, removing color selection for grid lines)

Gridlines display option view cb.png

  • pro:
    • simple and easy to understand options (two checkboxes with visible description instead of drop down that hides available settings - only the current value is visible in a drop down)
    • display option for gridlines on colored cell background is next to the general grid line display option (easy to catch)
    • easy to implement (view options are already available in the drawing implementation ScGridWindow::Draw)
  • con:
    • the color drop down would have been removed. Although there is a grid line color option in Tools > Options > LibreOffice > Appearance, some people seem to use the color setting from Calc > View page (according to OOo usage tracking data it is the second most used control at the view options page, after Grid Lines checkbox)

as compatibility option

Gridlines display option compat lb.png

  • pro:
    • would be placed on an option tab page which is currently almost empty
    • future visual compatibility options could be collected under that setting
  • con:
    • the option would be hard to find for users looking for it, it is unclear what "compatibility for sheet display" means.
    • it's harder to implement (could be done anyway - but would introduce several dependencies between calc option groups or pages that are currently separated)

There was another proposal to have this as a "per sheet" option at Format - Page. This was dropped, because it was to complicated to implement (we would have to move gridline settings to the Format - Page options first and make it a real document / sheet property first)

Additional Information

Related / Open bug reports

tdf#30800 - EasyHack?: UI: grid lines disappeared in Calc for cells with background color

For discussion also see the mailing lists:

subject on both lists is "Option for gridline display in Calc ({tdf#30800)"

Related whiteboard pages


File Format

no changes


A new boolean property "GridOnColoredCells" (path: "/org.openoffice.Office.Calc/Layout/Line") will be introduced. this is using the same config path and type as the "GridLine" property (which enables / disables grid line display).

  • If "GridOnColoredCells" is set to false (default) grid lines will not be displayed on cells with colored background. (UI option Grid line="Show" if GridLine-property is true)
  • If "GridOnColoredCells" is set to true grid lines will be displayed on cells with colored background. (UI option Grid line="Show on colored cells" if GridLine-property is true)
  • property will be read but ignored, when GridLine-property is false ( (UI option Grid line="Hide")


no migration needed, as we do not change or remove existing features.