Make row highlight configurable

This one is used to highlight current album in release group search from Other versions dialog
Defaults are unchanged.
This commit is contained in:
Laurent Monin
2024-05-21 11:07:42 +02:00
parent 205037081e
commit 41d2d013c8
2 changed files with 5 additions and 8 deletions

View File

@@ -47,6 +47,7 @@ _COLOR_DESCRIPTIONS = {
'log_warning': N_('Log view text (warning)'),
'profile_hl_bg': N_("Profile highlight background"),
'profile_hl_fg': N_("Profile highlight foreground"),
'row_highlight': N_("Row Highlight"),
'tagstatus_added': N_("Tag added"),
'tagstatus_changed': N_("Tag changed"),
'tagstatus_removed': N_("Tag removed"),
@@ -90,6 +91,8 @@ register_color(_DARK, 'profile_hl_fg', '#FFFFFF')
register_color(_LIGHT, 'profile_hl_fg', '#000000')
register_color(_DARK, 'profile_hl_bg', '#000080')
register_color(_LIGHT, 'profile_hl_bg', '#F9F906')
register_color(_LIGHT, 'row_highlight', '#FFFFE0')
register_color(_DARK, 'row_highlight', '#90907E')
class InterfaceColors:

View File

@@ -45,7 +45,7 @@ from picard.util import (
)
from picard.ui import PicardDialog
from picard.ui.theme import theme
from picard.ui.colors import interface_colors
class ResultTable(QtWidgets.QTableWidget):
@@ -183,13 +183,7 @@ class TableBasedDialog(PicardDialog):
def highlight_row(self, row):
model = self.table.model()
highlight_color = QtGui.QColor('LightYellow')
if theme.is_dark_theme:
highlight_color.setHsv(
highlight_color.hue(),
highlight_color.saturation(),
int(highlight_color.lightness() * .6),
highlight_color.alpha())
highlight_color = interface_colors.get_qcolor('row_highlight')
highlight_brush = QtGui.QBrush(highlight_color)
for column in range(0, model.columnCount()):
index = model.index(row, column)