Bug 87933 - Easier visibility of automatic page breaks
Summary: Easier visibility of automatic page breaks
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.5.0.0.alpha0+ Master
Hardware: Other All
: medium enhancement
Assignee: gkorepanov.gk
URL:
Whiteboard: target:5.4.0
Keywords: difficultyBeginner, easyHack, skillCpp, topicUI
Depends on:
Blocks: Writer-Page-Break
  Show dependency treegraph
 
Reported: 2015-01-01 11:40 UTC by Yousuf Philips (jay) (retired)
Modified: 2017-06-14 19:27 UTC (History)
15 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot 5.0.4-5.1.0-5.2.0 side by side (67.91 KB, image/png)
2015-12-05 16:23 UTC, m_a_riosv
Details
Automatic vs Manual page breaks (64.55 KB, image/png)
2016-01-26 12:22 UTC, Yousuf Philips (jay) (retired)
Details
Manual vs. automatic page break in 'page break' view mode (21.75 KB, image/png)
2016-01-26 12:56 UTC, Heiko Tietze
Details
Dashed pagebreak lines (98.93 KB, image/png)
2017-01-06 13:44 UTC, gkorepanov.gk
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yousuf Philips (jay) (retired) 2015-01-01 11:40:29 UTC
In Calc, the Grid lines have a gray color (~Gray 3.5 - #c0c0c0) and the automatic page breaks have a slightly darker gray color (Gray 6 - #808080) and this small color difference isnt very easy to see.

How other spreadsheet applications color their cells and page breaks.

MSO Excel 2010  : Grid Line #dadcdd, Page Break #000000 (Black) with dashes
MSO Excel 2003  : Grid Line #c0c0c0, Page Break #000000 (Black) with dashes
WPS Spreadsheet : Grid Line #d7d7d7, Page Break #000000 (Black) with dashes
Quattro Pro X7  : Grid Line #c0c0c0, Page Break #0000ff (Blue)
Calligra Sheets : Grid Line #c0c0c0, Page Break #ff0606 (Red)
Gnumeric        : Grid Line #c7c7c7
iWork Numbers   : Grid Line #a6a6a6

The use of dashes in MSO and WPS make it easier to distinguish that the page breaks from cell border colors, and most users dont set cell border styles (aka the dashes). Quattro Pro and Calligra have a color showing this difference, though you have to go into the View menu to turn on this page breaks view, which we also have called page break preview and it uses a dark blue color (#000080) for page breaks.

So i'd like to suggest the following:

1a) We stick with the gray page break color, but change grid lines to Gray 3 (#cccccc) and page breaks to Gray 7 (#666666) to solve the visibility issue and also add dashes to the page break.

or

1b) We go with the lighter blue color compared to the dark blue color from page break preview and add dashes to it.

The changing of the color seems to be easy to achieve as it is in Tools > Options > Appearance, while adding dashes would likely require some dev work.
Comment 1 A (Andy) 2015-01-01 12:03:15 UTC
I agree the visibility could be improved.

I am still a little bit undecided, but currently I personally would as a standard tend more to the proposal 1a to have not too much maybe irritating colours in the normal view, although you can of course change the colour in the TOOLS -> OPTIONS menu, so that the colour can be changed easily.
Comment 2 Katarina Behrens (Inactive) 2015-10-27 10:54:50 UTC
Easy hack indeed, very easy when it comes to changing the default colour (relevant colours live here: include/svtools/colorcfg.hxx)

DifficultyInteresting for drawing the dashed line, it requires some code reading/digging around so as how to actually do that.
Comment 3 aybuke 2015-10-31 19:55:38 UTC
Hi, I sent following patch for this bug:
https://gerrit.libreoffice.org/#/c/19706/
Comment 4 Yousuf Philips (jay) (retired) 2015-10-31 20:37:56 UTC
@Heiko, @Stuart, @Cor: What is your take on this? Use a dark gray or a blue for automatic page breaks?

It seems we have three colors for page breaks

0x000080 (Dark Blue) - CALCPAGEBREAK
Used in Page Break View (View > Page Break)

0x2300dc (Blue) - CALCPAGEBREAKMANUAL
Used when manual page breaks are added to a sheet (Sheet > Insert Page Break)

0x808080 (Gray) - CALCPAGEBREAKAUTOMATIC
Automatically added to show the boundaries of pages when printed
Comment 5 Joel Madero 2015-12-05 07:52:02 UTC
What's the status of this bug? I see a patch was committed and reviewed.
Comment 6 V Stuart Foote 2015-12-05 16:04:43 UTC
I prefer not to have a Blue based automatic page break. Adjustment to color of the solid lines is a good start.

So rather than COL_LIGHTGRAY (#c0c0c0) for the grids and COL_GRAY (#808080) for the page break, lightening the calc grid to #cccccc  (standard.soc GRAY 3) and the page break to the darker #666666 (standard.soc GRAY 7) makes the UI more readable.

https://gerrit.libreoffice.org/#/c/19706/ accomplishes just that. Half of Jay's proposal 1a.

But, I do have some concern over adding single RGB hex values to colorcfg.cxx for specific color needs piecemeal across the UI. 

Rather than assigning them in per attribute in colorcfg.cxx seems we should define additional named colors in the http://opengrok.libreoffice.org/xref/core/include/tools/color.hxx header file.  And then assign those.

At least a COL_GRAY3 and a COL_GRAY7, but perhaps define the names for a full set from the standard .soc?

That would probably be the better way to do this and similar color tweaks in the future.

The work to convert the page breaks from solid lines to dashed lines could then be done as a new EasyHack?
Comment 7 m_a_riosv 2015-12-05 16:23:04 UTC
Created attachment 121053 [details]
Screenshot 5.0.4-5.1.0-5.2.0 side by side

Seems fixed from 5.1, maybe could be added to the 5.1 release notes.
Comment 8 V Stuart Foote 2015-12-05 17:06:01 UTC
(In reply to m.a.riosv from comment #7)
> Created attachment 121053 [details]
> Screenshot 5.0.4-5.1.0-5.2.0 side by side
> 
> Seems fixed from 5.1, maybe could be added to the 5.1 release notes.

Sorry, but this has not been adjusted in source yet. 

Believe you are displaying manual page breaks (the #2300dc blue assigned to CALCPAGEBREAKMANUAL), with some other color customizations in your 5.0.4 and 5.1.0 configuration in the screen clips.

This was adjusting the mix of base grid and the automatic page break lines, your clips don't show enough of the sheet to include the automatic page break lines.
Comment 9 m_a_riosv 2015-12-05 18:06:39 UTC
There is not color customization for color scheme, only grid line color in Menu/Tools/Options/LibreOffice calc/View - visual aids - color -> chart3 for 5.0.4 and 5.1.0

Anyway please forgive the misunderstood.
Comment 10 Commit Notification 2015-12-06 12:21:37 UTC
Aybuke Ozdemir committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=22d4b98da59c9821e72cc1d4f9d94d57b7a12d51

tdf#87933 easier visibility of automatic page breaks

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2015-12-06 12:21:55 UTC
Aybuke Ozdemir committed a patch related to this issue.
It has been pushed to "libreoffice-5-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=52ac1a717b1869cb7d2ee710f50a15e216ced76c&h=libreoffice-5-1

tdf#87933 easier visibility of automatic page breaks

It will be available in 5.1.0.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Robinson Tryon (qubit) 2015-12-14 06:57:44 UTC Comment hidden (obsolete)
Comment 13 Akshay Deep 2016-01-24 10:48:39 UTC
I have submitted the following patch following the instructions in [Comment 6]

https://gerrit.libreoffice.org/#/c/21742/
Comment 14 Commit Notification 2016-01-25 06:57:21 UTC
akki95 committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=45e3e87ddcdfb14186ce6a9d8748fa4b31393600

tdf#87933 - Easier visibility of automatic page breaks.

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 15 Heiko Tietze 2016-01-26 12:21:52 UTC
I agree with suggestion 1a), but we should make sure that it has no side effects on other cell status like selection or not.
Furthermore the difference between manual and automatic page break should be clear. Excel does the trick with dashed and dotted lines, LibO uses blue vs. navy as well as bold or not. We should go with the line type only as indicator for where the break comes from, and the color (darker gray or blue, btw: why always blue, isn't Calc all about green?) to show the break on/off feature.
Comment 16 Yousuf Philips (jay) (retired) 2016-01-26 12:22:50 UTC
Created attachment 122216 [details]
Automatic vs Manual page breaks

So this is how it presently looks between manual (blue) and automatic (gray 7) page breaks.
Comment 17 Heiko Tietze 2016-01-26 12:56:18 UTC
Created attachment 122217 [details]
Manual vs. automatic page break in 'page break' view mode

(In reply to Heiko Tietze from comment #15)
> Furthermore the difference between manual and automatic page break should be
> clear. Excel does the trick with dashed and dotted lines, LibO uses blue vs.
> navy as well as bold or not. We should go with the line type only as
> indicator for where the break comes from, and the color (darker gray or
> blue, btw: why always blue, isn't Calc all about green?) to show the break
> on/off feature.

This consideration was about the 'page break' view mode. Attachment shows how it looks.
Comment 18 V Stuart Foote 2016-01-26 13:33:25 UTC
(In reply to Heiko Tietze from comment #17)
> This consideration was about the 'page break' view mode. Attachment shows
> how it looks.

Granted, but lets not conflate issues between grids for the normal view, with rendering of the page break views.  This issue was only about the normal view and distinguishing between the grid lines, automatic page break lines, and manual page break lines.

Only the work to render the page break lines dashed remains to be done here.

Work on the page break / print preview (the Navy line color is quite subtle) would be a completely new issue.
Comment 19 Robinson Tryon (qubit) 2016-02-18 14:52:24 UTC Comment hidden (obsolete)
Comment 20 jani 2016-05-03 06:30:45 UTC
Seems solved
Comment 21 V Stuart Foote 2016-05-03 13:51:18 UTC
@Jan, *

Colors are corrected, but adjusting the line styles for the manual page breaks to dashed remains to be done.  In closing this, were you going to spin that off as a new easyHack and link back to this issue?

Stuart
Comment 22 jani 2016-05-03 16:37:59 UTC
(In reply to V Stuart Foote from comment #21)
> @Jan, *
> 
> Colors are corrected, but adjusting the line styles for the manual page
> breaks to dashed remains to be done.  In closing this, were you going to
> spin that off as a new easyHack and link back to this issue?
> 
> Stuart

No I had no intention of that, I reviewed the patch and it looked solved, but now we have a comment with what remains to be done, so open again.
Comment 23 gkorepanov.gk 2017-01-01 10:47:24 UTC
Hi! I would like to assign myself for this bug, but now I'm quite stuck on where may I find files containing code responsible for drawing page break lines (I wanna complete the second part of the task by making the line dashed, since now it is still hardly visible).

I'd be very grateful for giving some code pointers and probably some helpful information.

Till I get any answer, I'm going to try to learn it by myself, but I'm not sure it is gonna be effective.
Comment 24 gkorepanov.gk 2017-01-02 19:05:49 UTC
Seems I'm getting closer to the core of the problem, so assigned bug to myself.

According to my considerations:

1) Here is where the line color set and line style must be set as well:

http://opengrok.libreoffice.org/xref/core/sc/source/ui/view/output.cxx#407

2) Here is where line is actually drawn:

http://opengrok.libreoffice.org/xref/core/sc/source/ui/view/output.cxx#472

3) The only thing I found for now to draw the dashed line is usage of aLineInfo object and passing it to RenderContext.DrawLine(). Looking for other ways, otherwise I will seemingly have to modify  aGrid.AddVerLine() code.
Comment 25 gkorepanov.gk 2017-01-06 13:44:43 UTC
Created attachment 130203 [details]
Dashed pagebreak lines
Comment 26 gkorepanov.gk 2017-01-06 13:48:07 UTC
I have implemented dashed pagebreak lines.
The main problem I've faced was that dashes length is scaled automatically when document is zoomed, so I add an optional parameter in DrawLine func to handle that.

Looks like that now:
https://bug-attachments.documentfoundation.org/attachment.cgi?id=130203

Please review it on gerrit:

https://gerrit.libreoffice.org/#/c/32779/
Comment 27 Heiko Tietze 2017-01-07 16:46:08 UTC
(In reply to gkorepanov.gk from comment #25)
> Created attachment 130203 [details]
> Dashed pagebreak lines

Looks good. Please make sure that dashed lines work also on hi-res displays.
Comment 28 Commit Notification 2017-01-09 07:21:59 UTC
George Korepanov committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c695869fd83c516d63330f352d63c9b601999f20

tdf#87933: made pagebreak lines dashed

It will be available in 5.4.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 29 jani 2017-01-11 07:16:15 UTC
Problem seems solved.