|
23 | 23 | from markups import find_markup_class_by_name, get_markup_for_file_name
|
24 | 24 | from markups.common import MODULE_HOME_PAGE
|
25 | 25 | from PyQt6.QtCore import QDir, QFile, QFileInfo, QPoint, Qt, QTimer, QUrl, pyqtSignal
|
26 |
| -from PyQt6.QtGui import QPalette, QTextCursor, QTextDocument |
27 |
| -from PyQt6.QtWidgets import QApplication, QMessageBox, QSplitter, QTextEdit |
| 26 | +from PyQt6.QtGui import QTextCursor, QTextDocument |
| 27 | +from PyQt6.QtWidgets import QMessageBox, QSplitter, QTextEdit |
28 | 28 |
|
29 | 29 | from ReText import app_version, converterprocess, globalSettings
|
30 | 30 | from ReText.editor import ReTextEdit
|
@@ -192,21 +192,6 @@ def getHtmlFromConverted(self, converted, includeStyleSheet=True, webenv=False):
|
192 | 192 | style = 'td, th { border: 1px solid #c3c3c3; padding: 0 3px 0 3px; }\n'
|
193 | 193 | style += 'table { border-collapse: collapse; }\n'
|
194 | 194 | style += 'img { max-width: 100%; }\n'
|
195 |
| - # QTextDocument seems to use media=screen even for printing |
196 |
| - if not isinstance(self.previewBox, QTextEdit) and not webenv: |
197 |
| - # https://github.com/retext-project/retext/pull/187 |
198 |
| - palette = QApplication.palette() |
199 |
| - fgColor = palette.color(QPalette.ColorRole.Text).name() |
200 |
| - bgColor = palette.color(QPalette.ColorRole.Base).name() |
201 |
| - linkColor = palette.color(QPalette.ColorRole.Link).name() |
202 |
| - visitedLinkColor = palette.color(QPalette.ColorRole.LinkVisited).name() |
203 |
| - style += ('@media screen {\n' |
204 |
| - f' html {{ color: {fgColor}; background-color: {bgColor}; }}\n' |
205 |
| - f' a, a * {{ color: {linkColor}; }}\n' |
206 |
| - f' a:visited, a:visited * {{ color: {visitedLinkColor}; }}\n' |
207 |
| - '}\n') |
208 |
| - # https://github.com/retext-project/retext/issues/408 |
209 |
| - style += '@media print { html { background-color: white; } }\n' |
210 | 195 | headers += '<style type="text/css">\n' + style + '</style>\n'
|
211 | 196 | baseName = self.getBaseName()
|
212 | 197 | if self.cssFileExists:
|
|
0 commit comments