From a15057835a78aedcb33e544cf2a94268bd048cf5 Mon Sep 17 00:00:00 2001 From: Petras Jokubauskas Date: Fri, 20 Oct 2017 15:35:53 +0200 Subject: [PATCH] fix: set foreground color for items which background color is statically set, so that values of those would be readable when OS uses dark theme. --- pyqtgraph/console/Console.py | 5 +++-- pyqtgraph/parametertree/parameterTypes.py | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pyqtgraph/console/Console.py b/pyqtgraph/console/Console.py index 72164f33..c5c2e7b1 100644 --- a/pyqtgraph/console/Console.py +++ b/pyqtgraph/console/Console.py @@ -115,7 +115,7 @@ class ConsoleWidget(QtGui.QWidget): self.write("
%s\n"%encCmd, html=True) self.execMulti(cmd) else: - self.write("
%s\n"%encCmd, html=True) + self.write("
%s\n"%encCmd, html=True) self.inCmd = True self.execSingle(cmd) @@ -209,7 +209,7 @@ class ConsoleWidget(QtGui.QWidget): else: if self.inCmd: self.inCmd = False - self.output.textCursor().insertHtml("

") + self.output.textCursor().insertHtml("

") #self.stdout.write("

") self.output.insertPlainText(strn) #self.stdout.write(strn) @@ -366,6 +366,7 @@ class ConsoleWidget(QtGui.QWidget): self.ui.exceptionStackList.addItem('-- exception caught here: --') item = self.ui.exceptionStackList.item(self.ui.exceptionStackList.count()-1) item.setBackground(QtGui.QBrush(QtGui.QColor(200, 200, 200))) + item.setForeground(QtGui.QBrush(QtGui.QColor(50, 50, 50))) self.frames.append(None) # And finish the rest of the stack up to the exception diff --git a/pyqtgraph/parametertree/parameterTypes.py b/pyqtgraph/parametertree/parameterTypes.py index d137410d..ec14faa1 100644 --- a/pyqtgraph/parametertree/parameterTypes.py +++ b/pyqtgraph/parametertree/parameterTypes.py @@ -400,6 +400,7 @@ class GroupParameterItem(ParameterItem): else: for c in [0,1]: self.setBackground(c, QtGui.QBrush(QtGui.QColor(220,220,220))) + self.setForeground(c, QtGui.QBrush(QtGui.QColor(100,100,100))) font = self.font(c) font.setBold(True) #font.setPointSize(font.pointSize()+1)