mirror of
https://github.com/arsenetar/dupeguru.git
synced 2024-10-31 22:05:58 +00:00
Merge pull request #701 from glubsy/PR_ref_row_background_color
Change reference row background color
This commit is contained in:
commit
1d05f8910d
@ -49,6 +49,8 @@ class Preferences(PreferencesBase):
|
||||
|
||||
self.result_table_ref_foreground_color =\
|
||||
get("ResultTableRefForegroundColor", self.result_table_ref_foreground_color)
|
||||
self.result_table_ref_background_color =\
|
||||
get("ResultTableRefBackgroundColor", self.result_table_ref_background_color)
|
||||
self.result_table_delta_foreground_color =\
|
||||
get("ResultTableDeltaForegroundColor", self.result_table_delta_foreground_color)
|
||||
|
||||
@ -100,6 +102,7 @@ class Preferences(PreferencesBase):
|
||||
self.details_dialog_override_theme_icons = False if not ISLINUX else True
|
||||
self.details_dialog_viewers_show_scrollbars = True
|
||||
self.result_table_ref_foreground_color = QColor(Qt.blue)
|
||||
self.result_table_ref_background_color = QColor(Qt.darkGray)
|
||||
self.result_table_delta_foreground_color = QColor(255, 142, 40) # orange
|
||||
self.resultWindowIsMaximized = False
|
||||
self.resultWindowRect = None
|
||||
@ -143,6 +146,7 @@ class Preferences(PreferencesBase):
|
||||
set_("DetailsDialogViewersShowScrollbars", self.details_dialog_viewers_show_scrollbars)
|
||||
set_("DetailsTableDeltaForegroundColor", self.details_table_delta_foreground_color)
|
||||
set_("ResultTableRefForegroundColor", self.result_table_ref_foreground_color)
|
||||
set_("ResultTableRefBackgroundColor", self.result_table_ref_background_color)
|
||||
set_("ResultTableDeltaForegroundColor", self.result_table_delta_foreground_color)
|
||||
set_("ResultWindowIsMaximized", self.resultWindowIsMaximized)
|
||||
set_("MainWindowIsMaximized", self.mainWindowIsMaximized)
|
||||
|
@ -173,6 +173,9 @@ On MacOS, the tab bar will fill up the window's width instead."))
|
||||
self.result_table_ref_foreground_color = ColorPickerButton(self)
|
||||
gridlayout.addRow(tr("Reference foreground color:"),
|
||||
self.result_table_ref_foreground_color)
|
||||
self.result_table_ref_background_color = ColorPickerButton(self)
|
||||
gridlayout.addRow(tr("Reference background color:"),
|
||||
self.result_table_ref_background_color)
|
||||
self.result_table_delta_foreground_color = ColorPickerButton(self)
|
||||
gridlayout.addRow(tr("Delta foreground color:"),
|
||||
self.result_table_delta_foreground_color)
|
||||
@ -287,6 +290,8 @@ use the modifier key to drag the floating window around") if ISLINUX else
|
||||
prefs.details_table_delta_foreground_color)
|
||||
self.result_table_ref_foreground_color.setColor(
|
||||
prefs.result_table_ref_foreground_color)
|
||||
self.result_table_ref_background_color.setColor(
|
||||
prefs.result_table_ref_background_color)
|
||||
self.result_table_delta_foreground_color.setColor(
|
||||
prefs.result_table_delta_foreground_color)
|
||||
try:
|
||||
@ -310,6 +315,7 @@ use the modifier key to drag the floating window around") if ISLINUX else
|
||||
prefs.details_dialog_vertical_titlebar = ischecked(self.details_dialog_vertical_titlebar)
|
||||
prefs.details_table_delta_foreground_color = self.details_table_delta_foreground_color.color
|
||||
prefs.result_table_ref_foreground_color = self.result_table_ref_foreground_color.color
|
||||
prefs.result_table_ref_background_color = self.result_table_ref_background_color.color
|
||||
prefs.result_table_delta_foreground_color = self.result_table_delta_foreground_color.color
|
||||
prefs.destination_type = self.copyMoveDestinationComboBox.currentIndex()
|
||||
prefs.custom_command = str(self.customCommandEdit.text())
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user