1
0
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:
Andrew Senetar 2020-10-27 21:53:53 -05:00 committed by GitHub
commit 1d05f8910d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 0 deletions

View File

@ -49,6 +49,8 @@ class Preferences(PreferencesBase):
self.result_table_ref_foreground_color =\ self.result_table_ref_foreground_color =\
get("ResultTableRefForegroundColor", 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 =\ self.result_table_delta_foreground_color =\
get("ResultTableDeltaForegroundColor", 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_override_theme_icons = False if not ISLINUX else True
self.details_dialog_viewers_show_scrollbars = True self.details_dialog_viewers_show_scrollbars = True
self.result_table_ref_foreground_color = QColor(Qt.blue) 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.result_table_delta_foreground_color = QColor(255, 142, 40) # orange
self.resultWindowIsMaximized = False self.resultWindowIsMaximized = False
self.resultWindowRect = None self.resultWindowRect = None
@ -143,6 +146,7 @@ class Preferences(PreferencesBase):
set_("DetailsDialogViewersShowScrollbars", self.details_dialog_viewers_show_scrollbars) set_("DetailsDialogViewersShowScrollbars", self.details_dialog_viewers_show_scrollbars)
set_("DetailsTableDeltaForegroundColor", self.details_table_delta_foreground_color) set_("DetailsTableDeltaForegroundColor", self.details_table_delta_foreground_color)
set_("ResultTableRefForegroundColor", self.result_table_ref_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_("ResultTableDeltaForegroundColor", self.result_table_delta_foreground_color)
set_("ResultWindowIsMaximized", self.resultWindowIsMaximized) set_("ResultWindowIsMaximized", self.resultWindowIsMaximized)
set_("MainWindowIsMaximized", self.mainWindowIsMaximized) set_("MainWindowIsMaximized", self.mainWindowIsMaximized)

View File

@ -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) self.result_table_ref_foreground_color = ColorPickerButton(self)
gridlayout.addRow(tr("Reference foreground color:"), gridlayout.addRow(tr("Reference foreground color:"),
self.result_table_ref_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) self.result_table_delta_foreground_color = ColorPickerButton(self)
gridlayout.addRow(tr("Delta foreground color:"), gridlayout.addRow(tr("Delta foreground color:"),
self.result_table_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) prefs.details_table_delta_foreground_color)
self.result_table_ref_foreground_color.setColor( self.result_table_ref_foreground_color.setColor(
prefs.result_table_ref_foreground_color) 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( self.result_table_delta_foreground_color.setColor(
prefs.result_table_delta_foreground_color) prefs.result_table_delta_foreground_color)
try: 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_dialog_vertical_titlebar = ischecked(self.details_dialog_vertical_titlebar)
prefs.details_table_delta_foreground_color = self.details_table_delta_foreground_color.color 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_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.result_table_delta_foreground_color = self.result_table_delta_foreground_color.color
prefs.destination_type = self.copyMoveDestinationComboBox.currentIndex() prefs.destination_type = self.copyMoveDestinationComboBox.currentIndex()
prefs.custom_command = str(self.customCommandEdit.text()) prefs.custom_command = str(self.customCommandEdit.text())

View File

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