Fix htmlbuilder

This commit is contained in:
Tim Bentley 2010-10-16 17:21:02 +01:00
parent cf2d215534
commit 7dcac8ea54
1 changed files with 9 additions and 6 deletions

View File

@ -370,29 +370,32 @@ def build_background_css(item, width, height):
theme = item.themedata
background = u'background-color: black'
if theme:
if theme.background_type == BackgroundType.Solid:
if theme.background_type == BackgroundType.to_string(BackgroundType.Solid):
background = u'background-color: %s' % theme.background_color
else:
if theme.background_direction == BackgroundGradientType.Horizontal:
if theme.background_direction == BackgroundGradientType.to_string \
(BackgroundGradientType.Horizontal):
background = \
u'background: ' \
u'-webkit-gradient(linear, left top, left bottom, ' \
'from(%s), to(%s))' % (theme.background_start_color,
theme.background_end_color)
elif theme.background_direction == BackgroundGradientType.LeftTop:
elif theme.background_direction == BackgroundGradientType.to_string \
(BackgroundGradientType.LeftTop):
background = \
u'background: ' \
u'-webkit-gradient(linear, left top, right bottom, ' \
'from(%s), to(%s))' % (theme.background_start_color,
theme.background_end_color)
elif theme.background_direction == \
BackgroundGradientType.LeftBottom:
elif theme.background_direction == BackgroundGradientType.to_string \
(BackgroundGradientType.LeftBottom):
background = \
u'background: ' \
u'-webkit-gradient(linear, left bottom, right top, ' \
'from(%s), to(%s))' % (theme.background_start_color,
theme.background_end_color)
elif theme.background_direction == BackgroundGradientType.Vertical:
elif theme.background_direction == BackgroundGradientType.to_string \
(BackgroundGradientType.Vertical):
background = \
u'background: -webkit-gradient(linear, left top, ' \
u'right top, from(%s), to(%s))' % \