mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
...
This commit is contained in:
parent
718bb559b2
commit
fdb50deca9
@ -178,13 +178,16 @@ class View:
|
|||||||
|
|
||||||
def get_color_scheme(self, apply_to_margins):
|
def get_color_scheme(self, apply_to_margins):
|
||||||
sd = get_session_data()
|
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]:
|
if default_color_schemes[cs]:
|
||||||
ans = 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:
|
elif ucs[cs] and ucs[cs].foreground and ucs[cs].background:
|
||||||
ans = sd.user_color_schemes[cs]
|
ans = ucs[cs]
|
||||||
else:
|
else:
|
||||||
ans = default_color_schemes['white']
|
for sn in default_color_schemes:
|
||||||
|
ans = default_color_schemes[sn]
|
||||||
|
break
|
||||||
if apply_to_margins:
|
if apply_to_margins:
|
||||||
for which in 'left top right bottom'.split(' '):
|
for which in 'left top right bottom'.split(' '):
|
||||||
s = document.getElementById('book-{}-margin'.format(which)).style
|
s = document.getElementById('book-{}-margin'.format(which)).style
|
||||||
|
Loading…
x
Reference in New Issue
Block a user