More appropriate function name

This commit is contained in:
Kovid Goyal 2019-12-30 10:47:04 +05:30
parent 3305fe4a14
commit 007823983b
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -561,10 +561,9 @@ class View:
def on_iframe_error(self, data):
ui_operations.show_error((data.title or _('There was an error processing the book')), data.msg, data.details)
def get_color_scheme(self, apply_to_margins):
def apply_color_scheme(self):
ans = resolve_color_scheme()
self.current_color_scheme = ans
if apply_to_margins:
for which in 'left top right bottom'.split(' '):
m = document.getElementById('book-{}-margin'.format(which))
s = m.style
@ -697,7 +696,7 @@ class View:
def iframe_settings(self, name):
sd = get_session_data()
bg_image_fade = 'transparent'
cs = self.get_color_scheme(True)
cs = self.apply_color_scheme()
fade = int(sd.get('background_image_fade'))
rgba = cached_color_to_rgba(cs.background)
is_dark_theme = max(rgba[0], rgba[1], rgba[2]) < 115
@ -1016,7 +1015,7 @@ class View:
self.iframe_wrapper.send_message('change_scroll_speed', lines_per_sec_auto=change_scroll_speed(amt))
def update_color_scheme(self):
cs = self.get_color_scheme(True)
cs = self.apply_color_scheme()
self.iframe_wrapper.send_message('change_color_scheme', color_scheme=cs)
def toggle_reference_mode(self):