Support dark themes for Qt documentation

Uses offline-dark.css instead of offline.css in case of Qt Creator using
a dark theme. Looks for the CSS file first in the shipped documentation,
otherwise uses a fallback that is shipped with Qt Creator. The fallback
is based on Qt 6.3.2 documentation, with colors replaced by palette
colors from the flat-dark theme (normalBackground, alternateBackground,
shadowBackground, text). Link colors are taken from the dark Qt online
CSS.

Makes sure to keep a light background for non-Qt documentation, since we
do not assume that they provide a dark themed CSS.

Fixes: QTCREATORBUG-26557
Change-Id: I4a09eedd1216cebeb87c12df40ad99ced030fa73
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Eike Ziller
2022-09-27 11:39:29 +02:00
parent e2352f1cc0
commit edcb5a7e6e
4 changed files with 826 additions and 6 deletions

View File

@@ -8,5 +8,6 @@
<file>images/mode_help_mask@2x.png</file>
<file>images/macos_touchbar_help.png</file>
<file>images/macos_touchbar_help@2x.png</file>
<file>offline-dark.css</file>
</qresource>
</RCC>