1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2026-01-22 14:41:39 +00:00

Colorize background for reference row

As per issue #647, highlight background color for reference for better readability.
This commit is contained in:
glubsy
2020-08-12 21:37:29 +02:00
parent 089f00adb8
commit 21e62b7374
3 changed files with 15 additions and 0 deletions

View File

@@ -29,6 +29,8 @@ class ResultsModel(Table):
def _getData(self, row, column, role):
if column.name == "marked":
if role == Qt.BackgroundRole and row.isref:
return QBrush(self.prefs.result_table_ref_background_color)
if role == Qt.CheckStateRole and row.markable:
return Qt.Checked if row.marked else Qt.Unchecked
return None
@@ -40,6 +42,9 @@ class ResultsModel(Table):
return QBrush(self.prefs.result_table_ref_foreground_color)
elif row.is_cell_delta(column.name):
return QBrush(self.prefs.result_table_delta_foreground_color)
elif role == Qt.BackgroundRole:
if row.isref:
return QBrush(self.prefs.result_table_ref_background_color)
elif role == Qt.FontRole:
font = QFont(self.view.font())
if self.prefs.reference_bold_font: