summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2021-10-15 16:33:07 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-10-20 09:16:42 +0000
commitd491b38f775c30784604a2d207a34ce0f8565739 (patch)
tree863038bf4847120dce808e4c2bce75441c648509
parent5b62f8a44c831e42fb45bfeaf678a7e906e563af (diff)
downloadqttools-d491b38f775c30784604a2d207a34ce0f8565739.tar.gz
Make docs' background white so that contents is visible in dark theme
Fixes: QTBUG-97125 Fixes: QTBUG-97516 Change-Id: I3ccc096bf3c176389724528a09a3b95ededa4aa7 Reviewed-by: Eike Ziller <eike.ziller@qt.io> (cherry picked from commit 661383e4df5a086e565a6abccffac3140e438745) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/assistant/assistant/helpviewer.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/assistant/assistant/helpviewer.cpp b/src/assistant/assistant/helpviewer.cpp
index a81a253ae..e0b24d526 100644
--- a/src/assistant/assistant/helpviewer.cpp
+++ b/src/assistant/assistant/helpviewer.cpp
@@ -201,6 +201,16 @@ HelpViewer::HelpViewer(qreal zoom, QWidget *parent)
setLayout(layout);
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(d->m_viewer, 10);
+
+ // Make docs' contents visible in dark theme
+ QPalette p = palette();
+ p.setColor(QPalette::Inactive, QPalette::Highlight,
+ p.color(QPalette::Active, QPalette::Highlight));
+ p.setColor(QPalette::Inactive, QPalette::HighlightedText,
+ p.color(QPalette::Active, QPalette::HighlightedText));
+ p.setColor(QPalette::Base, Qt::white);
+ p.setColor(QPalette::Text, Qt::black);
+ setPalette(p);
}
HelpViewer::~HelpViewer()