diff --git a/nw/gui/doceditor.py b/nw/gui/doceditor.py index a24a1f4e..79d84c1d 100644 --- a/nw/gui/doceditor.py +++ b/nw/gui/doceditor.py @@ -206,11 +206,16 @@ class GuiDocEditor(QTextEdit): theFont.setPointSize(self.mainConf.textSize) self.setFont(theFont) - docPalette = self.palette() - docPalette.setColor(QPalette.Window, QColor(*self.theTheme.colBack)) + mainPalette = self.palette() + mainPalette.setColor(QPalette.Window, QColor(*self.theTheme.colBack)) + mainPalette.setColor(QPalette.Base, QColor(*self.theTheme.colBack)) + mainPalette.setColor(QPalette.Text, QColor(*self.theTheme.colText)) + self.setPalette(mainPalette) + + docPalette = self.viewport().palette() docPalette.setColor(QPalette.Base, QColor(*self.theTheme.colBack)) docPalette.setColor(QPalette.Text, QColor(*self.theTheme.colText)) - self.setPalette(docPalette) + self.viewport().setPalette(docPalette) # Set default text margins cM = self.mainConf.getTextMargin() diff --git a/nw/gui/docviewer.py b/nw/gui/docviewer.py index 636c4637..8fcea123 100644 --- a/nw/gui/docviewer.py +++ b/nw/gui/docviewer.py @@ -112,11 +112,16 @@ class GuiDocViewer(QTextBrowser): theFont.setPointSize(self.mainConf.textSize) self.setFont(theFont) - docPalette = self.palette() - docPalette.setColor(QPalette.Window, QColor(*self.theTheme.colBack)) + mainPalette = self.palette() + mainPalette.setColor(QPalette.Window, QColor(*self.theTheme.colBack)) + mainPalette.setColor(QPalette.Base, QColor(*self.theTheme.colBack)) + mainPalette.setColor(QPalette.Text, QColor(*self.theTheme.colText)) + self.setPalette(mainPalette) + + docPalette = self.viewport().palette() docPalette.setColor(QPalette.Base, QColor(*self.theTheme.colBack)) docPalette.setColor(QPalette.Text, QColor(*self.theTheme.colText)) - self.setPalette(docPalette) + self.viewport().setPalette(docPalette) self.qDocument.setDocumentMargin(0) theOpt = QTextOption()