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

Add color picker buttons to preferences dialog

* Buttons display the color currently in use
* Result table uses selected colors accordingly
* Keep items aligned with GridLayouts in preference dialog
* Reordering of items in a more logical manner*
This commit is contained in:
glubsy
2020-07-22 21:38:03 +02:00
parent cf64565012
commit 9ae0d7e5cf
3 changed files with 93 additions and 20 deletions

View File

@@ -7,7 +7,7 @@
# http://www.gnu.org/licenses/gpl-3.0.html
from PyQt5.QtCore import Qt, pyqtSignal, QModelIndex
from PyQt5.QtGui import QBrush, QFont, QFontMetrics, QColor
from PyQt5.QtGui import QBrush, QFont, QFontMetrics
from PyQt5.QtWidgets import QTableView
from qtlib.table import Table
@@ -37,9 +37,9 @@ class ResultsModel(Table):
return data[column.name]
elif role == Qt.ForegroundRole:
if row.isref:
return QBrush(Qt.blue)
return QBrush(self.prefs.result_table_ref_foreground_color)
elif row.is_cell_delta(column.name):
return QBrush(QColor(255, 142, 40)) # orange
return QBrush(self.prefs.result_table_delta_foreground_color)
elif role == Qt.FontRole:
font = QFont(self.view.font())
if self.prefs.reference_bold_font: