Ebook viewer: Do not override the background color specified in the book if the user has not set a background color in the viewer preferences

This commit is contained in:
Kovid Goyal 2014-01-22 17:28:03 +05:30
parent ccc5b092be
commit 945f1be853

View File

@ -126,8 +126,7 @@ class Document(QWebPage): # {{{
mf.setScrollBarPolicy(Qt.Horizontal, Qt.ScrollBarAlwaysOff)
def set_user_stylesheet(self, opts):
bg = opts.background_color or 'white'
brules = ['background-color: %s !important'%bg]
brules = ['background-color: %s !important'%opts.background_color] if opts.background_color else ['background-color: white']
prefix = '''
body { %s }
'''%('; '.join(brules))