forked from openlp/openlp
try to fix gradient when using html5 doctype
This commit is contained in:
parent
948f166e06
commit
50b820af4e
@ -36,6 +36,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
# FIXME: Add html5 doctype. However, do not break theme gradients.
|
# FIXME: Add html5 doctype. However, do not break theme gradients.
|
||||||
HTMLSRC = u"""
|
HTMLSRC = u"""
|
||||||
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>OpenLP Display</title>
|
<title>OpenLP Display</title>
|
||||||
@ -393,18 +394,18 @@ def build_background_css(item, width, height):
|
|||||||
"""
|
"""
|
||||||
width = int(width) / 2
|
width = int(width) / 2
|
||||||
theme = item.themedata
|
theme = item.themedata
|
||||||
background = u'background-color: black'
|
background = u'background-color: black;'
|
||||||
if theme:
|
if theme:
|
||||||
if theme.background_type == \
|
if theme.background_type == \
|
||||||
BackgroundType.to_string(BackgroundType.Solid):
|
BackgroundType.to_string(BackgroundType.Solid):
|
||||||
background = u'background-color: %s' % theme.background_color
|
background = u'background-color: %s;' % theme.background_color
|
||||||
else:
|
else:
|
||||||
if theme.background_direction == BackgroundGradientType.to_string \
|
if theme.background_direction == BackgroundGradientType.to_string \
|
||||||
(BackgroundGradientType.Horizontal):
|
(BackgroundGradientType.Horizontal):
|
||||||
background = \
|
background = \
|
||||||
u'background: ' \
|
u'background: ' \
|
||||||
u'-webkit-gradient(linear, left top, left bottom, ' \
|
u'-webkit-gradient(linear, left top, left bottom, ' \
|
||||||
'from(%s), to(%s))' % (theme.background_start_color,
|
'from(%s), to(%s)) fixed;' % (theme.background_start_color,
|
||||||
theme.background_end_color)
|
theme.background_end_color)
|
||||||
elif theme.background_direction == \
|
elif theme.background_direction == \
|
||||||
BackgroundGradientType.to_string( \
|
BackgroundGradientType.to_string( \
|
||||||
@ -412,7 +413,7 @@ def build_background_css(item, width, height):
|
|||||||
background = \
|
background = \
|
||||||
u'background: ' \
|
u'background: ' \
|
||||||
u'-webkit-gradient(linear, left top, right bottom, ' \
|
u'-webkit-gradient(linear, left top, right bottom, ' \
|
||||||
'from(%s), to(%s))' % (theme.background_start_color,
|
'from(%s), to(%s)) fixed;' % (theme.background_start_color,
|
||||||
theme.background_end_color)
|
theme.background_end_color)
|
||||||
elif theme.background_direction == \
|
elif theme.background_direction == \
|
||||||
BackgroundGradientType.to_string \
|
BackgroundGradientType.to_string \
|
||||||
@ -420,20 +421,21 @@ def build_background_css(item, width, height):
|
|||||||
background = \
|
background = \
|
||||||
u'background: ' \
|
u'background: ' \
|
||||||
u'-webkit-gradient(linear, left bottom, right top, ' \
|
u'-webkit-gradient(linear, left bottom, right top, ' \
|
||||||
'from(%s), to(%s))' % (theme.background_start_color,
|
'from(%s), to(%s)) fixed;' % (theme.background_start_color,
|
||||||
theme.background_end_color)
|
theme.background_end_color)
|
||||||
elif theme.background_direction == \
|
elif theme.background_direction == \
|
||||||
BackgroundGradientType.to_string \
|
BackgroundGradientType.to_string \
|
||||||
(BackgroundGradientType.Vertical):
|
(BackgroundGradientType.Vertical):
|
||||||
background = \
|
background = \
|
||||||
u'background: -webkit-gradient(linear, left top, ' \
|
u'background: -webkit-gradient(linear, left top, ' \
|
||||||
u'right top, from(%s), to(%s))' % \
|
u'right top, from(%s), to(%s)) fixed;' % \
|
||||||
(theme.background_start_color, theme.background_end_color)
|
(theme.background_start_color, theme.background_end_color)
|
||||||
else:
|
else:
|
||||||
background = \
|
background = \
|
||||||
u'background: -webkit-gradient(radial, %s 50%%, 100, %s ' \
|
u'background: -webkit-gradient(radial, %s 50%%, 100, %s ' \
|
||||||
u'50%%, %s, from(%s), to(%s))' % (width, width, width,
|
u'50%%, %s, from(%s), to(%s)) fixed;' % (width, width,
|
||||||
theme.background_start_color, theme.background_end_color)
|
width, theme.background_start_color,
|
||||||
|
theme.background_end_color)
|
||||||
return background
|
return background
|
||||||
|
|
||||||
def build_lyrics_css(item, webkitvers):
|
def build_lyrics_css(item, webkitvers):
|
||||||
|
@ -103,6 +103,7 @@ class MainDisplay(QtGui.QGraphicsView):
|
|||||||
self.createMediaObject()
|
self.createMediaObject()
|
||||||
log.debug(u'Setup webView')
|
log.debug(u'Setup webView')
|
||||||
self.webView = QtWebKit.QWebView(self)
|
self.webView = QtWebKit.QWebView(self)
|
||||||
|
self.webView.settings().setAttribute(7, True)
|
||||||
self.webView.setGeometry(0, 0,
|
self.webView.setGeometry(0, 0,
|
||||||
self.screen[u'size'].width(), self.screen[u'size'].height())
|
self.screen[u'size'].width(), self.screen[u'size'].height())
|
||||||
self.page = self.webView.page()
|
self.page = self.webView.page()
|
||||||
|
Loading…
Reference in New Issue
Block a user