Skip to content

Commit

Permalink
Fix #2085312 [Tweaks editor - improve contrast in dark mode](https://…
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Oct 22, 2024
1 parent edefce2 commit 3855552
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/calibre/gui2/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -980,15 +980,16 @@ def initializeFormats(cls):
baseFormat = QTextCharFormat()
baseFormat.setFontFamilies(['monospace'])
p = QApplication.instance().palette()
is_dark = QApplication.instance().is_dark_theme
for name, color, bold, italic in (
("normal", None, False, False),
("keyword", p.color(QPalette.ColorRole.Link).name(), True, False),
("builtin", p.color(QPalette.ColorRole.Link).name(), False, False),
("constant", p.color(QPalette.ColorRole.Link).name(), False, False),
("decorator", "#0000E0", False, False),
("comment", "#007F00", False, True),
("string", "#808000", False, False),
("number", "#924900", False, False),
("comment", '#00c700' if is_dark else "#007F00", False, True),
("string", '#b6b600' if is_dark else "#808000", False, False),
("number", '#d96d00' if is_dark else "#924900", False, False),
("error", "#FF0000", False, False),
("pyqt", "#50621A", False, False)):

Expand Down

0 comments on commit 3855552

Please sign in to comment.