mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-23 09:34:30 +01:00
Comments editor: Fix syntax coloring for HTML view in dark mode
This commit is contained in:
parent
e0ab635448
commit
a19f61bc5f
1 changed files with 10 additions and 4 deletions
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
from calibre import xml_replace_entities
|
||||
from calibre.ebooks.chardet import xml_to_unicode
|
||||
from calibre.gui2 import NO_URL_FORMATTING, choose_files, error_dialog, gprefs
|
||||
from calibre.gui2 import NO_URL_FORMATTING, choose_files, error_dialog, gprefs, is_dark_theme
|
||||
from calibre.gui2.book_details import css
|
||||
from calibre.gui2.widgets import LineEditECM
|
||||
from calibre.gui2.widgets2 import to_plain_text
|
||||
|
|
@ -840,10 +840,16 @@ def __init__(self, doc):
|
|||
self.colors = {}
|
||||
self.colors['doctype'] = QColor(192, 192, 192)
|
||||
self.colors['entity'] = QColor(128, 128, 128)
|
||||
self.colors['tag'] = QColor(136, 18, 128)
|
||||
self.colors['comment'] = QColor(35, 110, 37)
|
||||
self.colors['attrname'] = QColor(153, 69, 0)
|
||||
self.colors['attrval'] = QColor(36, 36, 170)
|
||||
if is_dark_theme():
|
||||
from calibre.gui2.palette import dark_link_color
|
||||
self.colors['tag'] = QColor(186, 78, 188)
|
||||
self.colors['attrname'] = QColor(193, 119, 60)
|
||||
self.colors['attrval'] = dark_link_color
|
||||
else:
|
||||
self.colors['tag'] = QColor(136, 18, 128)
|
||||
self.colors['attrname'] = QColor(153, 69, 0)
|
||||
self.colors['attrval'] = QColor(36, 36, 170)
|
||||
|
||||
def highlightBlock(self, text):
|
||||
state = self.previousBlockState()
|
||||
|
|
|
|||
Loading…
Reference in a new issue