Bug 153808 - Preview in the Bullets and Numbering is not painting bullets/numbers in dark mode
Summary: Preview in the Bullets and Numbering is not painting bullets/numbers in dark ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
7.6.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Rafael Lima
URL:
Whiteboard: target:7.6.0 target:7.5.3
Keywords:
Depends on:
Blocks: Impress-Bullet-Numbering-Dialog Dark-Mode
  Show dependency treegraph
 
Reported: 2023-02-24 14:55 UTC by Rafael Lima
Modified: 2023-03-24 09:03 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot showing the problem (49.74 KB, image/png)
2023-02-24 14:55 UTC, Rafael Lima
Details
Screenshots of the patch using "Automatic" and "Dark" color schemes (195.01 KB, application/vnd.oasis.opendocument.graphics)
2023-03-01 12:33 UTC, Rafael Lima
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rafael Lima 2023-02-24 14:55:27 UTC
Created attachment 185569 [details]
Screenshot showing the problem

In Impress, if you open the Bullets and Numbering dialog when using a dark mode, you'll get a preview without bullets and numbers. See attached screenshot for more details.

The reason is here:
https://opengrok.libreoffice.org/xref/core/cui/source/tabpages/numpages.cxx?r=71001798#2194

Notice that the color used as background of the output device is GetFieldColor(), which in a dark theme is a dark color. Later in lcl_DrawBullet we use this color to determine the bullet color:

aBulletColor = pVDev->GetFillColor().IsDark() ? COL_WHITE : COL_BLACK;

But since pDev is using a dark FieldColor, then COL_WHITE will be used over a white background in the preview.

Since this is a preview of the document, we should instead use DOCCOLOR and FONTCOLOR from svtools/colorcfg.hxx

System info

Version: 7.5.0.3 (X86_64) / LibreOffice Community
Build ID: 50(Build:3)
CPU threads: 16; OS: Linux 5.19; UI render: default; VCL: kf5 (cairo+xcb)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Ubuntu package version: 1:7.5.0~rc3-0ubuntu0.22.10.1~lo1
Calc: threaded
Comment 1 V Stuart Foote 2023-02-24 17:16:52 UTC
confirmed

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 74dc2ac66f0130bcd77cf1bbe417b22865beb067
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded
Comment 2 Rafael Lima 2023-02-24 18:24:56 UTC
Proposed patch here:
https://gerrit.libreoffice.org/c/core/+/147664
Comment 3 Rafael Lima 2023-03-01 12:33:10 UTC
Created attachment 185667 [details]
Screenshots of the patch using "Automatic" and "Dark" color schemes

This file shows the effect of this patch when using the "Automatic" and "Dark" color schemes.
Comment 4 Commit Notification 2023-03-22 19:53:09 UTC
Rafael Lima committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3a4b32c9e1dfc56d9b00e3720834d21c9095f629

tdf#153808 Fix numbering preview in dark mode

It will be available in 7.6.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 5 Commit Notification 2023-03-24 09:03:40 UTC
Rafael Lima committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

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

tdf#153808 Fix numbering preview in dark mode

It will be available in 7.5.3.

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.