mirror of
https://github.com/akissinger/dodo.git
synced 2024-10-03 22:17:15 +03:00
Merge pull request #72 from The-Compiler/color-overrides
Implement per-tag color overrides
This commit is contained in:
commit
b1d1e43fcf
@ -131,6 +131,11 @@ class SearchModel(QAbstractItemModel):
|
||||
font.setBold(True)
|
||||
return font
|
||||
elif role == Qt.ItemDataRole.ForegroundRole:
|
||||
for tag in settings.search_color_overrides.keys() & thread_d['tags']:
|
||||
if col in settings.search_color_overrides[tag]:
|
||||
color = settings.search_color_overrides[tag][col]
|
||||
return QColor(color)
|
||||
|
||||
color = 'fg_' + col
|
||||
unread_color = 'fg_' + col + '_unread'
|
||||
flagged_color = 'fg_' + col + '_flagged'
|
||||
|
@ -338,3 +338,26 @@ Example configuration using this feature to highlight markdown syntax:
|
||||
pygments_css = pygments.formatters.HtmlFormatter(style="gruvbox-dark").get_style_defs()
|
||||
dodo.settings.message_css += pygments_css.replace("{", "{{").replace("}", "}}")
|
||||
"""
|
||||
|
||||
search_color_overrides = {}
|
||||
"""A dictionary mapping tags to color dictionaries.
|
||||
|
||||
The color dictionaries map columns to override colors.
|
||||
The available columns are:
|
||||
|
||||
- date
|
||||
- from
|
||||
- subject
|
||||
- tags
|
||||
|
||||
For example, to show a red subject for messages tagged 'urgent',
|
||||
using the built-in Gruvbox palette:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
dodo.settings.search_color_overrides = {
|
||||
'urgent': {
|
||||
'subject': dodo.themes.gruvbox_p['neutral_red'],
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user