From: "Lubomir I. Ivanov" <[email protected]>

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 <[email protected]>
---
 qt-ui/usermanual.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/qt-ui/usermanual.cpp b/qt-ui/usermanual.cpp
index 6bbfb79..6b676f1 100644
--- a/qt-ui/usermanual.cpp
+++ b/qt-ui/usermanual.cpp
@@ -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()) {
-- 
1.7.11.msysgit.0

_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to