--- a/eric6/UI/CodeDocumentationViewer.py Sun Apr 12 13:06:07 2020 +0200 +++ b/eric6/UI/CodeDocumentationViewer.py Sun Apr 12 14:45:14 2020 +0200 @@ -17,6 +17,7 @@ ) from E5Gui.E5TextEditSearchWidget import E5TextEditSearchWidget +from E5Gui.E5Application import e5App import Preferences @@ -29,11 +30,43 @@ from .data import codeDocumentationViewer_rc # __IGNORE_WARNING__ -# TODO: complete the support for color schemes as soon as Qt 5.14 is released class DocumentationViewerWidget(QWidget): """ Class implementing a rich text documentation viewer. """ + EmpytDocument_Light = ( + '''<!DOCTYPE html>\n''' + '''<html lang="EN">\n''' + '''<head>\n''' + '''<style type="text/css">\n''' + '''html {background-color: #ffffff;}\n''' + '''body {background-color: #ffffff;\n''' + ''' color: #000000;\n''' + ''' margin: 0px 10px 10px 10px;\n''' + '''}\n''' + '''</style''' + '''</head>\n''' + '''<body>\n''' + '''</body>\n''' + '''</html>''' + ) + EmpytDocument_Dark = ( + '''<!DOCTYPE html>\n''' + '''<html lang="EN">\n''' + '''<head>\n''' + '''<style type="text/css">\n''' + '''html {background-color: #262626;}\n''' + '''body {background-color: #262626;\n''' + ''' color: #ffffff;\n''' + ''' margin: 0px 10px 10px 10px;\n''' + '''}\n''' + '''</style''' + '''</head>\n''' + '''<body>\n''' + '''</body>\n''' + '''</html>''' + ) + def __init__(self, parent=None): """ Constructor @@ -113,7 +146,10 @@ if self.__viewerType == "QTextEdit": self.__contents.clear() else: - self.__contents.setHtml("") + if e5App().usesDarkPalette(): + self.__contents.setHtml(self.EmpytDocument_Dark) + else: + self.__contents.setHtml(self.EmpytDocument_Light) class CodeDocumentationViewer(QWidget):