Bug 143733 - Make selection border wider
Summary: Make selection border wider
Status: CLOSED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.1.5.2 release
Hardware: All All
: medium enhancement
Assignee: Heiko Tietze
URL:
Whiteboard: target:7.4.0 inReleaseNotes:7.4 targe...
Keywords:
: 154815 (view as bug list)
Depends on:
Blocks: Cell-Selection
  Show dependency treegraph
 
Reported: 2021-08-04 22:03 UTC by fml2
Modified: 2024-08-27 11:13 UTC (History)
12 users (show)

See Also:
Crash report or crash signature:


Attachments
Selection in Calc (3.81 KB, image/png)
2021-08-04 22:04 UTC, fml2
Details
Selection in Excel (4.54 KB, image/png)
2021-08-04 22:05 UTC, fml2
Details
Screenshot (21.91 KB, image/png)
2022-01-24 07:49 UTC, Heiko Tietze
Details
Focus rectangle outside (10.45 KB, image/png)
2024-04-29 14:35 UTC, Heiko Tietze
Details

Note You need to log in before you can comment on or make changes to this bug.
Description fml2 2021-08-04 22:03:47 UTC
Description:
This has been first noted in Bug 142959, but I think it deserves a separate ticket.

IMO the selection border in Calc (i.e. the border that marks the current cell) is drawn in a suboptimal way. It's drawn *within* the cell space thus eating space from the information in focus (the current cell).

IMO Excel does it in a smarter way. Excel draws the border around the cell, but the border is *beyond* the cell so that the "interesting" information is not "cropped".

See the attached images that should explain what I mean.

Steps to Reproduce:
Create an empty sheet and put the "cursor" to the cell B2.

Actual Results:
The selection border is within the cell.

Expected Results:
The selection border is beyond the cell.


Reproducible: Always


User Profile Reset: No



Additional Info:
This would make Calc visually more attractive.
Comment 1 fml2 2021-08-04 22:04:41 UTC
Created attachment 174089 [details]
Selection in Calc
Comment 2 fml2 2021-08-04 22:05:39 UTC
Created attachment 174090 [details]
Selection in Excel
Comment 3 Heiko Tietze 2021-09-02 07:26:15 UTC
Made the rectangle slightly larger and adjust it according the selection. When you zoom in the line width grows up to 4px.
Comment 4 S.Zosgornik 2021-09-03 02:19:37 UTC
I very agree. The active cell border should be drawn around the current cell.
This was the best behavior MS Excel ever did.

There may still compatibility-issues inside LO Calc  with double cell orders but
drawing a 2 pixel wide highlighting border (or maybe even 3) should solve this.

This would address the problem that Calc covers the current cell border color.
Comment 5 Commit Notification 2022-01-17 07:47:06 UTC
Heiko Tietze committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/c32994e22ff291b0227ed74de6d0d050cf0901c8

Resolves tdf#143733 - Make selection border wider

It will be available in 7.4.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 6 fml2 2022-01-23 10:35:31 UTC
Thanks for implementing! Are there screenshots of the new feature? If possible, with different zoom levels. Could you attach them to the issue? Thank you!
Comment 7 Heiko Tietze 2022-01-24 07:49:50 UTC
Created attachment 177730 [details]
Screenshot

Zoom at 50, 100 and 200% using KDE but with gtk3 VCL.
Comment 8 fml2 2022-01-24 08:26:11 UTC
Thank you for creating the attachment!

May I add some comments?

1. Zoom 50%: The border is very uneven. Top and right lines are much thicker than the bottom and left ones. Besides, the bottom line is *within* the cell (and the subject of this ticket was to place it outside the cell). But I personally never work at 50% zoom hence this case is not important for me.


2. Zoom 100%. I see that the left and top lines are half within and half outside the cell. Could we make the lines completely outside the cell so that no inner space is eaten by the border at all?

The right and the bottom lines are mainly *within* the cell, i.e. the border is not drawn in a symmentical way. Could you please also fix that?


3. Zoom 200%. Same comments as for 100% apply.


Also, because there are still issues with this, could we reactivate the ticket? I think it would be an overkill to open a new one for those.

Thank you!
Comment 9 Heiko Tietze 2022-01-24 08:58:03 UTC
(In reply to al.le from comment #8)
> 1. Zoom 50%: The border is very uneven.
Some aliasing or rounding issue, haven't seen it on Windows. Ultimately I cannot do much without spoiling the 100% too much. Goal was to keep the size at 100% as close as possible to what we had before and to make it smaller at 50% and reasonably larger when zoomed in. Plus, lines should always be centered on the border.

> 2. ...Could we make the lines completely outside the cell

Yes, but why? To keep the content free of formatting? Please also consider left- and top-most cells.

Please test the patch with a nightly build. Looking at pictures can be misleading. And yes, you can reopen the ticket if needed.
Comment 10 fml2 2022-01-24 11:34:40 UTC
If I'm not mistaken, the border would look better if you add "+1" to the right and bottom coordinates (which was deleted with the commit). At least with 100% and 200%.

I.e.

basegfx::B2DRange aRB(rRA.Left() - MinSize - fZoom, rRA.Top() - MinSize - fZoom,
                      rRA.Right() + MinSize + fZoom + 1, rRA.Bottom() + MinSize + fZoom + 1);
Comment 11 fml2 2022-01-24 11:45:04 UTC
Since the result is still not 100% satisfying, I reactivate the ticket.
Comment 12 fml2 2022-01-25 10:34:18 UTC
> Please also consider left- and top-most cells.

I checked how it's done in Excel. They have marks in the row and column headings that mark the current cell. The marks have the same color as the border. If e.g. a left most cell is selected, the mark becomes the left side of the border.

Since LO does not have such marks, this solution would not fit here.

Also, I've checked that Excel draws the border very accurately regardles of the zoom. There are no rounding effects at all. Everything is always exact to the pixel.
Comment 13 Stéphane Guillou (stragu) 2022-04-13 00:45:13 UTC
fml2: can you confirm that have you tested a recent daily build? If so, do you find the current state satisfactory?

https://dev-builds.libreoffice.org/daily/master/current.html
Comment 14 fml2 2022-04-13 14:34:53 UTC
I've tried it with the build 2022-04-13 03:23:47. The border looks better now, i.e. it is drawn symmetrically around the cell.

But the main point of this issue is still missed since the border is still drawn *within* the cell and not "outside" of it.
Comment 15 QA Administrators 2022-04-14 03:41:33 UTC Comment hidden (obsolete)
Comment 16 Stéphane Guillou (stragu) 2023-07-11 08:31:41 UTC
Verified in 24.2, and added to release notes: https://wiki.documentfoundation.org/index.php?title=ReleaseNotes%2F7.4&type=revision&diff=677789&oldid=650328
Comment 17 flklb-bugs 2023-07-28 12:44:06 UTC
Coming from bug 154815 (the wider border now cuts off parts of my cell text, see attachment):

Is there any chance to make the adaption of selection border width with zoom level optional or, respectively, make the actual width configurable somehow?
Comment 18 Heiko Tietze 2024-04-29 14:31:12 UTC
*** Bug 154815 has been marked as a duplicate of this bug. ***
Comment 19 Heiko Tietze 2024-04-29 14:35:07 UTC
Created attachment 193895 [details]
Focus rectangle outside

New tentative patch https://gerrit.libreoffice.org/c/core/+/166870 moves the focus rectangle out of the actual cell. It considers the zoom factor; the screenshot is taken at 100%.
Comment 20 flklb-bugs 2024-04-29 21:51:26 UTC
Not sure about the extra padding between cell border and focus rectangle. Makes it larger than necessary to just prevent cutting off highlighted cell content. Even cuts considerably into neighboring cells now on top of that. Also looks a bit strange to me.

Could this extra padding be avoided/removed? Would probably be OK then.

(I would actually still prefer the much more subtle solution of simply having a thinner or configurable width for the focus rectangle, though.)
Comment 21 fml2 2024-04-29 22:54:49 UTC
How does this look for the cell A1?
Comment 22 Stéphane Guillou (stragu) 2024-04-30 04:12:18 UTC
(In reply to flklb-bugs from comment #20)
> Not sure about the extra padding between cell border and focus rectangle.
> Makes it larger than necessary to just prevent cutting off highlighted cell
> content. Even cuts considerably into neighboring cells now on top of that.
> Also looks a bit strange to me.
> 
> Could this extra padding be avoided/removed? Would probably be OK then.
See related bug 108240. It would be useful to avoid hiding cell borders. That's what Apple's Numbers does, for example. But it's true that Numbers' cursor is significantly thinner: attachment 188313 [details].
Comment 23 Heiko Tietze 2024-04-30 06:18:12 UTC Comment hidden (noise)
Comment 24 ady 2024-04-30 06:46:22 UTC Comment hidden (noise)
Comment 25 Heiko Tietze 2024-04-30 07:08:00 UTC Comment hidden (noise)
Comment 26 Commit Notification 2024-04-30 07:22:37 UTC
Heiko Tietze committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/9e7d70230212ab95cda957a0fe51e37f7ca95021

Related tdf#143733 - Cell focus must not cover content

It will be available in 24.8.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 27 Adolfo Jayme Barrientos 2024-04-30 07:23:54 UTC
I say let’s take the change slowly, avoiding both knee-jerk reactions and unnecessary bikeshedding. And avoid reopening old bugs :)
Comment 28 Buovjaga 2024-05-05 06:01:00 UTC
There is a regression from 7.1 that is influencing how this looks after a certain number of rows: bug 153624 comment 9.
Comment 29 Sergey Nemna 2024-05-14 14:40:23 UTC
@Heiko Tietze

Maybe, you could consider possibility to make this change optional (implement some checkbox in settings or something). I very much realise the rationale behind this request, but the issue has never troubled some of users. And new look does not appease anyone.

Anyway, it is always good to have a choice, especially, when it comes to aesthetics (admittedly, it means more work for a programmer...).
Comment 30 Heiko Tietze 2024-05-15 07:26:14 UTC
(In reply to Sergey Nemna from comment #29)
And new look does not appease anyone.
More opinions please.

I'm against the suggested option for this visual detail.
Comment 31 Sergey Nemna 2024-05-15 08:13:18 UTC
(In reply to Heiko Tietze from comment #30)
> (In reply to Sergey Nemna from comment #29)
> And new look does not appease anyone.
> More opinions please.
> 
> I'm against the suggested option for this visual detail.

Well, enforcing changes in something people have got used to without providing option to switch back is typical for... some companies. I mean irreversible changes done without good, obvious and well-justified reasons. I am for changes, but against enforcing.

But it is just a personal opinion, feel free to disregard it.
Comment 32 Buovjaga 2024-05-15 09:12:22 UTC
(In reply to Sergey Nemna from comment #31)
> (In reply to Heiko Tietze from comment #30)
> > (In reply to Sergey Nemna from comment #29)
> > And new look does not appease anyone.
> > More opinions please.
> > 
> > I'm against the suggested option for this visual detail.
> 
> Well, enforcing changes in something people have got used to without
> providing option to switch back is typical for... some companies. I mean
> irreversible changes done without good, obvious and well-justified reasons.
> I am for changes, but against enforcing.
> 
> But it is just a personal opinion, feel free to disregard it.

Having an option always means an additional maintenance cost. Every option needs to have its own automated testing, code maintenance to adapt to compiler and standard changes etc.
Comment 33 steve 2024-05-15 11:12:47 UTC
Welcome to the core issue of discussing UI.

Let me add another personal opinion: I for one am enjoying the clear selection and the fact it is outside the selected cell helps me to focus on the cell content and prevents messing around with cell content and. decreasing visibility of e.g. cell comment indicator. Also cell highlighting has come a long way on macOS. We went from "no support for system accent color" to supporting that and ensuring good visibility for both dark and light mode. UX has improved a lot for the past years and are now in a good state. Nice to see the progress.
 
+1 for the change.
Comment 34 Tomaz Vajngerl 2024-06-04 10:29:08 UTC
The outside selection doesn't look good when you zoom in. Would be better to have a constant number of pixels gap outside of the cell which is independent to the zoom level - currently the gap changes depending on the zoom level.
Comment 35 Buovjaga 2024-06-04 10:46:44 UTC
(In reply to Tomaz Vajngerl from comment #34)
> The outside selection doesn't look good when you zoom in. Would be better to
> have a constant number of pixels gap outside of the cell which is
> independent to the zoom level - currently the gap changes depending on the
> zoom level.

It looks fine to me. What's the problem? Matter of taste?
Comment 36 ady 2024-06-04 12:50:02 UTC
(In reply to Tomaz Vajngerl from comment #34)
> The outside selection doesn't look good when you zoom in. Would be better to
> have a constant number of pixels gap outside of the cell which is
> independent to the zoom level - currently the gap changes depending on the
> zoom level.

You are not the only one suggesting that the new gap should not be proportional to zoom level. See tdf#161234.
Comment 37 Tomaz Vajngerl 2024-06-04 13:08:53 UTC
(In reply to ady from comment #36)
> You are not the only one suggesting that the new gap should not be
> proportional to zoom level. See tdf#161234.

Ah.. I may not have the latest state then.
Comment 38 steve 2024-06-05 12:26:13 UTC
Please provide screenshots of any remaining issues, since otherwise it is otherwise unnecessarily complicated to discuss. Follow-up issues would be appreciated to continue the debate on a per problem basis.
Comment 39 Eyal Rozenberg 2024-06-22 16:04:17 UTC
This change should really not have happened IMNSHO:

* The width we had before was sufficient (talking about 100% zoom here, I'm not commenting about other zoom levels), but more importantly:
* Any increase in width hides either the contents of the cell itself, or contents of adjacent cells if the rectangle is outside the cell. And that's exactly what happened.
Comment 40 maison 2024-08-25 21:25:14 UTC
The way it’s implemented in 24.8.0.3 is UGLY. Now it crops from the adjacent cells. Why is there lost space between the cell border and the blue selection border.

To make things worse, now it’s harder to get the mouse + sign when you want to draw the content of the current cell in one direction to fill the adjacent cells; these two embedded rectangles confuse it.
Comment 41 Buovjaga 2024-08-26 06:30:06 UTC
(In reply to maison from comment #40)
> The way it’s implemented in 24.8.0.3 is UGLY. Now it crops from the adjacent
> cells. Why is there lost space between the cell border and the blue
> selection border.
> 
> To make things worse, now it’s harder to get the mouse + sign when you want
> to draw the content of the current cell in one direction to fill the
> adjacent cells; these two embedded rectangles confuse it.

See bug 161709 and test with a fresh daily build.
Comment 42 steve 2024-08-27 11:13:16 UTC
I am not happy about the way this discussion is had. Screenshots were requested but instead of providing screenshots, opinionated comments are made.

Even a thicker cell highlight doesn't necessarily mean cell content of surrounding cells is hidden if implemented correctly. Obviously no one has an interest in working with a UI which hides content, may that be inside or outside of the highlighted cell. But lets discuss how this can be resolved instead of adding comments like "I don't like it because it is ugly".

@maison: if you have trouble selecting something, please do file about about that. Link it with this bug here, provide a video showing calc and your mouse and the selection issue you are having. Then a discussion can be had, how to solve the issue you are seeing.

Thank you.