mirror of
https://github.com/fergalmoran/picard.git
synced 2026-02-16 12:43:59 +00:00
Merge pull request #2482 from zas/configurable_colors
Make few more colors configurable
This commit is contained in:
@@ -41,12 +41,14 @@ _COLOR_DESCRIPTIONS = {
|
||||
'entity_error': N_("Errored entity"),
|
||||
'entity_pending': N_("Pending entity"),
|
||||
'entity_saved': N_("Saved entity"),
|
||||
'first_cover_hl': N_("First cover art"),
|
||||
'log_debug': N_('Log view text (debug)'),
|
||||
'log_error': N_('Log view text (error)'),
|
||||
'log_info': N_('Log view text (info)'),
|
||||
'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 +92,10 @@ 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')
|
||||
register_color(_LIGHT, 'first_cover_hl', 'darkgoldenrod')
|
||||
register_color(_DARK, 'first_cover_hl', 'orange')
|
||||
|
||||
|
||||
class InterfaceColors:
|
||||
|
||||
@@ -63,6 +63,7 @@ from picard.util import (
|
||||
)
|
||||
from picard.util.lrucache import LRUCache
|
||||
|
||||
from picard.ui.colors import interface_colors
|
||||
from picard.ui.item import FileListItem
|
||||
from picard.ui.widgets import ActiveLabel
|
||||
|
||||
@@ -293,9 +294,9 @@ class CoverArtThumbnail(ActiveLabel):
|
||||
cx -= displacements
|
||||
cy += displacements
|
||||
if not has_common_images:
|
||||
# Draw a golden highlight around the first cover to indicate that
|
||||
# Draw a highlight around the first cover to indicate that
|
||||
# images are not common to all selected items
|
||||
color = QtGui.QColor('darkgoldenrod')
|
||||
color = interface_colors.get_qcolor('first_cover_hl')
|
||||
border_length = 10
|
||||
for k in range(border_length):
|
||||
color.setAlpha(255 - k * 255 // border_length)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user