From 7735b0c9f799ddb7a6f2f549c4950f689fa0d6f8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 6 Dec 2016 08:43:32 +0530 Subject: [PATCH] Edit Book: Fix selected text not being fully highlighted when using the solarized color schemes. Fixes #1647448 [Selected text not visible in ebook-editor with solarized-dark theme](https://bugs.launchpad.net/calibre/+bug/1647448) --- src/calibre/gui2/tweak_book/editor/themes.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/tweak_book/editor/themes.py b/src/calibre/gui2/tweak_book/editor/themes.py index ffe2e67c5a..25a11f5f1a 100644 --- a/src/calibre/gui2/tweak_book/editor/themes.py +++ b/src/calibre/gui2/tweak_book/editor/themes.py @@ -49,7 +49,7 @@ SOLARIZED = \ PmenuSel fg={base01} bg={base2} Cursor fg={base03} bg={base0} - Normal fg={base0} bg={base03} + Normal fg={base0} bg={base02} LineNr fg={base01} bg={base02} LineNrC fg={magenta} Visual fg={base01} bg={base03} @@ -201,6 +201,7 @@ def read_color(col): except Exception: pass + Highlight = namedtuple('Highlight', 'fg bg bold italic underline underline_color') @@ -235,6 +236,7 @@ def read_theme(raw): ans[name] = Highlight(fg, bg, bold, italic, underline, underline_color) return ans + THEMES = {k:read_theme(raw) for k, raw in THEMES.iteritems()} @@ -243,6 +245,8 @@ def u(x): if 'Dot' in x: return x + 'Line' return x + 'Underline' + + underline_styles = {x:getattr(QTextCharFormat, u(x)) for x in underline_styles} @@ -474,6 +478,8 @@ class Property(QWidget): self.changed.emit() # Help text {{{ + + HELP_TEXT = _('''\

Creating a custom theme

@@ -685,6 +691,7 @@ class ThemeEditor(Dialog): return QSize(min(1500, g.width() - 25), 650) # }}} + if __name__ == '__main__': app = QApplication([]) d = ThemeEditor()