From da159f11d43ccb4b51c50f11296ad3ec2d18f751 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Wed, 14 Oct 2015 16:30:16 +0800 Subject: [PATCH] gui/log: ensure black/white colors --- artiq/gui/log.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/artiq/gui/log.py b/artiq/gui/log.py index a696617d8..51e6aefac 100644 --- a/artiq/gui/log.py +++ b/artiq/gui/log.py @@ -28,6 +28,8 @@ class _LogModel(ListSyncModel): self.fixed_font = QtGui.QFont() self.fixed_font.setFamily("Monospace") + self.white = QtGui.QBrush(QtGui.QColor(255, 255, 255)) + self.black = QtGui.QBrush(QtGui.QColor(0, 0, 0)) self.debug_fg = QtGui.QBrush(QtGui.QColor(55, 55, 55)) self.warning_bg = QtGui.QBrush(QtGui.QColor(255, 255, 180)) self.error_bg = QtGui.QBrush(QtGui.QColor(255, 150, 150)) @@ -43,13 +45,13 @@ class _LogModel(ListSyncModel): elif level >= logging.WARNING: return self.warning_bg else: - return ListSyncModel.data(self, index, role) + return self.white elif role == QtCore.Qt.ForegroundRole and index.isValid(): level = self.backing_store[index.row()][0] if level <= logging.DEBUG: return self.debug_fg else: - return ListSyncModel.data(self, index, role) + return self.black else: return ListSyncModel.data(self, index, role)