mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
usermanual.cpp: use default QWidget theme colors for text selections
The default selection text/background colors (also when seaching) are black/light-grey in QWebView, for some reason. To solve the issue we pass a stylesheet that makes use of the default palette's highlight() and highlightedText() from QWidget. Fixes #797 Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
313f76542e
commit
acbdd0edc3
1 changed files with 4 additions and 1 deletions
|
@ -54,8 +54,11 @@ UserManual::UserManual(QWidget *parent) : QWidget(parent)
|
|||
setWindowTitle(tr("User manual"));
|
||||
setWindowIcon(QIcon(":/subsurface-icon"));
|
||||
|
||||
|
||||
userManual = new QWebView(this);
|
||||
QString colorBack = palette().highlight().color().name(QColor::HexRgb);
|
||||
QString colorText = palette().highlightedText().color().name(QColor::HexRgb);
|
||||
userManual->setStyleSheet(QString("QWebView { selection-background-color: %1; selection-color: %2; }")
|
||||
.arg(colorBack).arg(colorText));
|
||||
userManual->page()->setLinkDelegationPolicy(QWebPage::DelegateExternalLinks);
|
||||
QString searchPath = getSubsurfaceDataPath("Documentation");
|
||||
if (searchPath.size()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue