eric6/UI/CodeDocumentationViewerTemplate.py

changeset 7523
6e26ec343c78
parent 7360
9190402e4505
child 7716
313e09453306
--- a/eric6/UI/CodeDocumentationViewerTemplate.py	Sat Apr 11 14:13:25 2020 +0200
+++ b/eric6/UI/CodeDocumentationViewerTemplate.py	Sat Apr 11 14:50:48 2020 +0200
@@ -10,6 +10,8 @@
 
 from PyQt5.QtCore import QCoreApplication
 
+from E5Gui.E5Application import e5App
+
 import Utilities
 
 
@@ -28,7 +30,7 @@
         <html>
         <head>
         <meta http-equiv="content-type" content="text/html; charset=utf-8">
-        <link rel="stylesheet" href="qrc:documentViewerStyle.css"
+        <link rel="stylesheet" href="qrc:documentViewerStyle-{0}.css"
             type="text/css" />
         </head>
         <body>
@@ -142,7 +144,7 @@
         )
     
     return (
-        mainTemplate
+        mainTemplate.format("dark" if e5App().usesDarkPalette() else "light")
         .replace("@HEADER@", header)
         .replace("@DOCSTRING@", docstring)
     )
@@ -162,7 +164,7 @@
         <html>
         <head>
         <meta http-equiv="content-type" content="text/html; charset=utf-8">
-        <link rel="stylesheet" href="qrc:documentViewerStyle.css"
+        <link rel="stylesheet" href="qrc:documentViewerStyle-{0}.css"
             type="text/css" />
         </head>
         <body>
@@ -171,7 +173,10 @@
         </html>
     """
     
-    return mainTemplate.replace("@TEXT@", text)
+    return (
+        mainTemplate.format("dark" if e5App().usesDarkPalette() else "light")
+        .replace("@TEXT@", text)
+    )
 
 
 def prepareDocumentationViewerHtmlWarningDocument(text):
@@ -188,7 +193,7 @@
         <html>
         <head>
         <meta http-equiv="content-type" content="text/html; charset=utf-8">
-        <link rel="stylesheet" href="qrc:documentViewerStyle.css"
+        <link rel="stylesheet" href="qrc:documentViewerStyle-{0}.css"
             type="text/css" />
         </head>
         <body>
@@ -197,4 +202,7 @@
         </html>
     """
     
-    return mainTemplate.replace("@TEXT@", text)
+    return (
+        mainTemplate.format("dark" if e5App().usesDarkPalette() else "light")
+        .replace("@TEXT@", text)
+    )

eric ide

mercurial