Fix error highlighting in search and replace tab of bulk metadata edit in dark mode

This commit is contained in:
Kovid Goyal 2019-12-15 18:09:25 +05:30
parent e9780b2a35
commit c7f8350eca
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -10,7 +10,7 @@ from threading import Thread
from PyQt5.Qt import (
QCompleter, QCoreApplication, QDateTime, QDialog, QDialogButtonBox, QFont, QProgressBar,
QGridLayout, QInputDialog, QLabel, QLineEdit, QSize, Qt, QVBoxLayout, pyqtSignal
QGridLayout, QInputDialog, QLabel, QLineEdit, QSize, Qt, QVBoxLayout, pyqtSignal, QApplication
)
from calibre import prints
@ -886,12 +886,9 @@ class MetadataBulkDialog(QDialog, Ui_MetadataBulkDialog):
def s_r_set_colors(self):
if self.s_r_error is not None:
col = 'rgba(255, 0, 0, 20%)'
self.test_result.setText(error_message(self.s_r_error))
else:
col = 'rgba(0, 255, 0, 20%)'
self.test_result.setStyleSheet('QLineEdit { color: black; '
'background-color: %s; }'%col)
self.test_result.setStyleSheet(
QApplication.instance().stylesheet_for_line_edit(self.s_r_error is not None))
for i in range(0,self.s_r_number_of_books):
getattr(self, 'book_%d_result'%(i+1)).setText('')