From fdb50deca997d7eeba1f230d43518a748c337ec4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 25 Sep 2016 11:29:17 +0530 Subject: [PATCH] ... --- src/pyj/read_book/view.pyj | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/pyj/read_book/view.pyj b/src/pyj/read_book/view.pyj index ea90c3bd54..bb525acfb5 100644 --- a/src/pyj/read_book/view.pyj +++ b/src/pyj/read_book/view.pyj @@ -178,13 +178,16 @@ class View: def get_color_scheme(self, apply_to_margins): sd = get_session_data() - cs = sd.current_color_scheme or 'white' + cs = sd.get('current_color_scheme') or 'white' + ucs = sd.get('user_color_schemes') if default_color_schemes[cs]: ans = default_color_schemes[cs] - elif sd.user_color_schemes[cs] and sd.user_color_schemes[cs].foreground and sd.user_color_schemes[cs].background: - ans = sd.user_color_schemes[cs] + elif ucs[cs] and ucs[cs].foreground and ucs[cs].background: + ans = ucs[cs] else: - ans = default_color_schemes['white'] + for sn in default_color_schemes: + ans = default_color_schemes[sn] + break if apply_to_margins: for which in 'left top right bottom'.split(' '): s = document.getElementById('book-{}-margin'.format(which)).style