Bug 143098 - The 'Styles Preview' section in the Tabbed NB doesn't follow the system theme like the sidebar
Summary: The 'Styles Preview' section in the Tabbed NB doesn't follow the system theme...
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.1.4.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: reviewed:2022
Keywords: difficultyMedium, easyHack, skillCpp, topicDesign
: 140428 146289 (view as bug list)
Depends on:
Blocks: UI-Theming Notebookbar-Tabbed Linux-Dark-Mode
  Show dependency treegraph
 
Reported: 2021-06-27 21:45 UTC by yizl44p8
Modified: 2023-01-09 08:43 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
The heading styles section (17.64 KB, image/png)
2021-06-27 21:45 UTC, yizl44p8
Details
LO 7.6 on GNOME dark theme + LO dark colour scheme (154.68 KB, image/png)
2023-01-06 09:52 UTC, Stéphane Guillou (stragu)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description yizl44p8 2021-06-27 21:45:03 UTC
Description:
N/A

Steps to Reproduce:
1. Use a dark theme in GNOME or a dark color scheme in KDE Plasma.
2. Open LibreOffice Writer.

Actual Results:
In the ribbon UI, the heading styles section is white and the font is grey, creating a bad contrast.

Expected Results:
The background of the heading styles section should follow the system theme and the font color should adapt to the background.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.1.4.2
Build ID: 10(Build:2)
CPU threads: 8; OS: Linux 5.12; UI render: default; VCL: kf5
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 1 yizl44p8 2021-06-27 21:45:36 UTC
Created attachment 173235 [details]
The heading styles section
Comment 2 V Stuart Foote 2021-06-28 01:30:43 UTC
LibreOffice does not implement a 'Ribbon UI'

However, in the Tabbed Notebook Bar (NB) the 'Styles Preview' icon view based widget [1] does not seem to correctly pickup fg/bg colors of the os/DE theme.

For OP please retest with a 7.2.0 beta or a build of master against 7.3.0 which has the patch.

@Szymon, could the previews be made theme aware?

Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 1db375e06516d0532f01f9585986617aa3079866
CPU threads: 8; OS: Windows 10.0 Build 19042; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded

=-ref-=
[1] https://gerrit.libreoffice.org/c/core/+/110408
Comment 3 Szymon Kłos 2021-06-28 06:15:09 UTC
I think it is possible. 

We have two things to do:
1. be sure IconView widget follows the theme
2. use different colors set for rendering previews if dark theme is applied

Code pointers:
[1] https://opengrok.libreoffice.org/xref/core/vcl/source/treelist/iconview.cxx?r=217b9423#31
[2] https://opengrok.libreoffice.org/xref/core/svx/source/tbxctrls/StylesPreviewWindow.cxx?r=04cd6749#235
Comment 4 Heiko Tietze 2021-06-28 07:44:35 UTC Comment hidden (off-topic)
Comment 5 yizl44p8 2021-07-03 07:40:03 UTC Comment hidden (off-topic)
Comment 6 yizl44p8 2021-07-03 07:40:35 UTC Comment hidden (off-topic)
Comment 7 yizl44p8 2021-07-03 07:40:59 UTC Comment hidden (off-topic)
Comment 8 Heiko Tietze 2021-07-05 07:13:46 UTC Comment hidden (off-topic)
Comment 9 Buovjaga 2021-07-21 19:55:29 UTC
*** Bug 140428 has been marked as a duplicate of this bug. ***
Comment 10 Stéphane Guillou (stragu) 2021-12-18 14:33:30 UTC
*** Bug 146289 has been marked as a duplicate of this bug. ***
Comment 11 Stéphane Guillou (stragu) 2021-12-18 14:42:32 UTC
I agree the tabbed UI's style preview should follow the same colour scheme as the Style sidebar.

Still the case with:

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: 06ac18e6302d666c363740644a7976e8c22d1113
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded
Comment 12 Heiko Tietze 2021-12-20 09:42:47 UTC
Please retest, it works well for me with black font on white background using

Version: 7.2.4.1 / LibreOffice Community
Build ID: 20(Build:1)
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: kf5 (cairo+xcb)
Locale: de-DE (en_US.UTF-8); UI: en-US
7.2.4-3
Calc: threaded

(KDE with Breeze Dark)
Comment 13 Stéphane Guillou (stragu) 2021-12-22 02:48:16 UTC
Heiko, I haven't been able to reproduce the grey font issue either, but can we make this bug the one about this style preview section following the dark theme exactly as the sidebar does?

As Yizi said for expected results:

"The background of the heading styles section should follow the system theme and the font color should adapt to the background."

Which is why I marked bug 146289 as a duplicate.

Changing bug summary to add "like the sidebar".
Comment 14 Heiko Tietze 2022-01-03 10:36:32 UTC
(In reply to stragu from comment #13)
> "The background of the heading styles section should follow the system theme
> and the font color should adapt to the background."

The Stylist is not always the best solution, see bug 137705. The paragraph style dropdown in the classic toolbar has also a full-design preview - but in this case without colors. We discussed the topic a couple of times and resolved tickets as WF.
Comment 15 Stéphane Guillou (stragu) 2022-01-03 22:44:58 UTC
(In reply to Heiko Tietze from comment #14)

> The Stylist is not always the best solution, see bug 137705. The paragraph
> style dropdown in the classic toolbar has also a full-design preview - but
> in this case without colors. We discussed the topic a couple of times and
> resolved tickets as WF.

Right, there's obviously been a lot more discussion around this elsewhere, thanks for linking.
In general, I'd say it's a shame there is inconsistency between toolbar(s) and sidebar, but I will trust the Design and UX/UI teams' opinion on what should be done with this bug.
Comment 16 Hossein 2022-11-15 13:59:47 UTC
Re-evaluating the EasyHack in 2022

This issue is still relevant. The color of the heading styles section in the tabbed UI does not match the dark color scheme.

This problem still persist with the latest LO 7.5 dev master:

Version: 7.5.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 022eafa4d69bc8290aa304b69af2c325fe3d2a02
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

I don't see the gray color of the font. For me, it is black text over white background.
Comment 17 Stéphane Guillou (stragu) 2023-01-06 09:52:53 UTC
Created attachment 184506 [details]
LO 7.6 on GNOME dark theme + LO dark colour scheme

Revisiting this bug, I now think the previews in the Tabbed UI can have more "freedom" in how they are rendered, closer to reality, because:
- it is clearly a "Styles preview" area, as opposed to a list; and more importantly:
- the style name is duplicated, so readability of the preview itself does not matter as much.

Compared the what was reported by OP, the situation has greatly improved in that the names are now duplicated, and the area around the actual previews does follow the OS dark theme.

In this attachment, I use:
- a recent master build on Ubuntu 20.04 with GNOME 3.36.8's Dark theme
- the LibreOffice Dark colour scheme in Options > Personnalisation
- a green area background for Text Body

Observations:
- both the Styles sidebar and the Tabbed UI preview use the right custom area colour, which is fine. However, in my opinion, the styles sidebar should automatically flip the text colour for readability (see bug 138979, bug 137705, bug 115507...). Even though we have the option to untick "Show previews", it is the default setting.
- none follow the Dark colour scheme, but I believe that's fine too. The full previews should show what will come out of a print or PDF, no need to follow the in-editor colour customisations.

In essence, my opinion is:
- The current situation in the Tabbed UI preview is enough visually. It follows the OS dark theme as much as it should (i.e., only around the previews)
- The Styles sidebar _can_ give hints as to what the styles look like, but it should both follow the UI _and_ keep the names readable as they are not duplicated.

So, for the issue tracked in this bug report, I would close as Resolved - Works For Me.
Comment 18 Heiko Tietze 2023-01-09 08:43:51 UTC
The Stylist showing white on white issue has been discussed in bug 115507 (resolved WF because of WYSIWYG but with a lot of duplicates and see also references) and bug 118854 (kept open). See also bug 137705 (Stylist not using document colors and I wonder why it seems to work in the screenshot).

Stephané's screenshot shows a pretty nice solution for the Notebookbar and I concur with WFM.