From d0bcf638d767b13b532a9569efdfaa46fff9a8e5 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Wed, 15 Jul 2020 19:22:06 -0500 Subject: [PATCH] Change INI error link blue color in dark mode. --- calibre-plugin/dialogs.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/calibre-plugin/dialogs.py b/calibre-plugin/dialogs.py index 08fae875..bbd77dd2 100644 --- a/calibre-plugin/dialogs.py +++ b/calibre-plugin/dialogs.py @@ -21,7 +21,7 @@ from datetime import datetime try: from PyQt5 import QtWidgets as QtGui from PyQt5 import QtCore - from PyQt5.Qt import (QDialog, QWidget, QTableWidget, QVBoxLayout, QHBoxLayout, + from PyQt5.Qt import (QApplication, QDialog, QWidget, QTableWidget, QVBoxLayout, QHBoxLayout, QGridLayout, QPushButton, QFont, QLabel, QCheckBox, QIcon, QLineEdit, QComboBox, QProgressDialog, QTimer, QDialogButtonBox, QScrollArea, QPixmap, Qt, QAbstractItemView, QTextEdit, @@ -29,7 +29,7 @@ try: except ImportError as e: from PyQt4 import QtGui from PyQt4 import QtCore - from PyQt4.Qt import (QDialog, QWidget, QTableWidget, QVBoxLayout, QHBoxLayout, + from PyQt4.Qt import (QApplication, QDialog, QWidget, QTableWidget, QVBoxLayout, QHBoxLayout, QGridLayout, QPushButton, QFont, QLabel, QCheckBox, QIcon, QLineEdit, QComboBox, QProgressDialog, QTimer, QDialogButtonBox, QScrollArea, QPixmap, Qt, QAbstractItemView, QTextEdit, @@ -1514,7 +1514,10 @@ class ViewLog(SizePersistedDialog): error_msg=error_msg[:200]+" ..." label = QLabel('%s: %s'%(lineno, error_msg)) label.setWordWrap(True) - label.setStyleSheet("QLabel { margin-left: 2em; color : blue; } QLabel:hover { color: red; }"); + if QApplication.instance().is_dark_theme: + label.setStyleSheet("QLabel { margin-left: 2em; color : aqua; } QLabel:hover { color: red; }"); + else: + label.setStyleSheet("QLabel { margin-left: 2em; color : blue; } QLabel:hover { color: red; }"); label.setToolTip(_('Click to go to line %s')%lineno) label.mouseReleaseEvent = partial(self.label_clicked, lineno=lineno) self.sl.addWidget(label)