Bug 147927 - Make focus rectangle more visible when editing formulas in Calc
Summary: Make focus rectangle more visible when editing formulas in Calc
Status: ASSIGNED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.4.0.0 alpha0+
Hardware: All All
: medium enhancement
Assignee: Rafael Lima
URL:
Whiteboard:
Keywords:
: 159314 (view as bug list)
Depends on:
Blocks: Calc-UX Selection
  Show dependency treegraph
 
Reported: 2022-03-11 15:30 UTC by Rafael Lima
Modified: 2024-03-19 16:13 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Images describing the proposal (117.52 KB, application/vnd.oasis.opendocument.graphics)
2022-03-11 15:30 UTC, Rafael Lima
Details
Screenshots from Excel and Google Sheets (235.97 KB, application/vnd.oasis.opendocument.graphics)
2022-03-14 13:12 UTC, Rafael Lima
Details
Sample ODS file (14.51 KB, application/vnd.oasis.opendocument.spreadsheet)
2022-03-14 13:15 UTC, Rafael Lima
Details
Formula editing BEFORE the patch (97.08 KB, image/png)
2024-03-16 14:26 UTC, Rafael Lima
Details
Formula editing AFTER the patch (104.68 KB, image/png)
2024-03-16 14:26 UTC, Rafael Lima
Details
Reference selection BEFORE the patch (104.20 KB, image/png)
2024-03-16 14:27 UTC, Rafael Lima
Details
Reference selection AFTER the patch (122.59 KB, image/png)
2024-03-16 14:27 UTC, Rafael Lima
Details
Issue with OutputDevice::DrawTransparent (16.24 KB, image/png)
2024-03-19 14:01 UTC, Rafael Lima
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rafael Lima 2022-03-11 15:30:35 UTC
Created attachment 178818 [details]
Images describing the proposal

Recent work on Bug 143733 has made the selection border thicker in LO Calc, which is great and improves visibility a lot.

I would like to suggest the same thickness be applied to the rectangle surrounding ranges used in formulas (see attached ODG image for more details).

Basically, when you double-click a formula that contains ranges, Calc highlight these ranges using a colored rectangle. However, they're too thin and hard to see.

Note that the borders I used in the screenshot are only 0.75 pt (which is the default border thickness). The problem gets worse when zooming in.

Screenshots taken with:

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: 2c13433ed38e08be60824f21a73ba29f78b9520f
CPU threads: 16; OS: Linux 5.13; UI render: default; VCL: kf5 (cairo+xcb)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Calc: CL
Comment 1 Heiko Tietze 2022-03-14 12:20:34 UTC
Cell focus rectangle scales depending on zoom level. At 50% it will be as small as before. Some users might see fat borders as obtrusive.
Comment 2 Rafael Lima 2022-03-14 13:12:45 UTC
Created attachment 178877 [details]
Screenshots from Excel and Google Sheets

Hi Heiko, IMO the way LO currently draws a rectangle around the cell range could have more highlight, to provide the user clearer feedback on which ranges are part of the formula.

For example, see the attached ODG where I took screenshots of how Excel (online and desktop) as well as Google Sheets address this issue. They basically use background highlight colors to make it more visible to the user. We could adopt this strategy in LO as well.

Just as a side note, this issue became more apparent to me while using LO Calc during class, where I show spreadsheets using a projector and I have to zoom in so that students can see what I'm teaching. When I double-clicked a formula, I was not able to see the rectangles, because they were to thin. And on my laptop I could barely see them. If we had thicker borders or a background highlight color, this issue could be solved.
Comment 3 Rafael Lima 2022-03-14 13:15:39 UTC
Created attachment 178878 [details]
Sample ODS file

This is the ODS file I used in the screenshots.
Comment 4 Cor Nouws 2022-03-15 18:43:14 UTC
Hi Rafael,

from attachment 178878 [details] and attachment 178818 [details] I do not see a difference in lines of the selection.
Or is it that you mean the highlighting should be less opaque?
Comment 5 Rafael Lima 2022-03-15 20:38:02 UTC
(In reply to Cor Nouws from comment #4)
> from attachment 178878 [details] and attachment 178818 [details] I do not
> see a difference in lines of the selection.
> Or is it that you mean the highlighting should be less opaque?

Hi Cor, initially I opened this enhancement request to suggest that lines around ranges be thicker, so that they would be more visible to users. Notice in the screenshots that in Excel the lines around the ranges are thicker and more apparent.

However, I'm now starting to think that changing the line width might not be the best approach, but rather to use a semi-transparent highlight color to show users which ranges are part of the formula.

I changed the title of the bug report to emphasize that the objective is to make the ranges more visible while editing formulas, be it by using thicker lines and/or by applying highlight color.
Comment 6 Heiko Tietze 2022-03-17 07:06:55 UTC
We had this topic on the agenda of the design meeting. 

The consistent look and feel justifies the request. So let's do it.
Comment 7 Rafael Lima 2024-01-22 13:15:35 UTC
*** Bug 159314 has been marked as a duplicate of this bug. ***
Comment 8 Rafael Lima 2024-03-16 14:26:18 UTC
Created attachment 193141 [details]
Formula editing BEFORE the patch
Comment 9 Rafael Lima 2024-03-16 14:26:40 UTC
Created attachment 193142 [details]
Formula editing AFTER the patch
Comment 10 Rafael Lima 2024-03-16 14:27:29 UTC
Created attachment 193143 [details]
Reference selection BEFORE the patch
Comment 11 Rafael Lima 2024-03-16 14:27:48 UTC
Created attachment 193144 [details]
Reference selection AFTER the patch
Comment 12 Rafael Lima 2024-03-16 14:31:43 UTC
Proposed patch here
https://gerrit.libreoffice.org/c/core/+/164874

This patch makes the outline more visible and ads a semi-transparent rectangle to the range. With this LO Calc now is more similar to what GDocs and MSO offers.

Please, provide feedback.
Comment 13 Rafael Lima 2024-03-19 14:01:27 UTC
Created attachment 193194 [details]
Issue with OutputDevice::DrawTransparent

I am having an issue with the method OutputDevice::DrawTransparent. As seen in the screenshot, the resulting rectangle is not entirely painted at first. But if I scroll up/down, it gets repainted and all is ok.

Does anyone know what may be causing this?

In the patch, the code pointer is:
mpDev->DrawTransparent(tools::PolyPolygon(tools::Polygon(aRect)), lclBackgroundRectTransparency);

What I'll do to overcome this is force repaint. But if anyone knows a better way, please let me know.