Left+Bottom align footer, and prevent wrapping

bzr-revno: 1021
This commit is contained in:
Jonathan Corwin 2010-09-09 19:05:08 +01:00
commit 15a155044f
2 changed files with 11 additions and 16 deletions

View File

@ -279,7 +279,7 @@ def build_html(item, screen, alert, islive):
html = HTMLSRC % (build_background_css(item, width, height),
width, height,
build_alert_css(alert, width),
build_footer_css(item),
build_footer_css(item, height),
build_lyrics_css(item, webkitvers),
u'true' if theme and theme.display_slideTransition and islive \
else u'false',
@ -503,7 +503,7 @@ def build_lyrics_html(item, webkitvers):
u'class="lyricscell lyricsmain"></div></div>'
return lyrics
def build_footer_css(item):
def build_footer_css(item, height):
"""
Build the display of the item footer
@ -512,26 +512,21 @@ def build_footer_css(item):
"""
style = """
left: %spx;
top: %spx;
bottom: %spx;
width: %spx;
height: %spx;
font-family: %s;
font-size: %spt;
color: %s;
text-align: %s;
text-align: left;
white-space:nowrap;
"""
theme = item.themedata
if not theme or not item.footer:
return u''
if theme.display_horizontalAlign == 2:
align = u'center'
elif theme.display_horizontalAlign == 1:
align = u'right'
else:
align = u'left'
lyrics_html = style % (item.footer.x(), item.footer.y(),
item.footer.width(), item.footer.height(), theme.font_footer_name,
theme.font_footer_proportion, theme.font_footer_color, align)
bottom = height - int(item.footer.y()) - int(item.footer.height())
lyrics_html = style % (item.footer.x(), bottom,
item.footer.width(), theme.font_footer_name,
theme.font_footer_proportion, theme.font_footer_color)
return lyrics_html
def build_alert_css(alertTab, width):

View File

@ -56,7 +56,7 @@ BLANK_THEME_XML = \
<weight>Normal</weight>
<italics>False</italics>
<line_adjustment>0</line_adjustment>
<location override="False" x="10" y="10" width="1004" height="730"/>
<location override="False" x="10" y="10" width="1004" height="690"/>
</font>
<font type="footer">
<name>Arial</name>
@ -65,7 +65,7 @@ BLANK_THEME_XML = \
<weight>Normal</weight>
<italics>False</italics>
<line_adjustment>0</line_adjustment>
<location override="False" x="10" y="730" width="1004" height="38"/>
<location override="False" x="10" y="690" width="1004" height="78"/>
</font>
<display>
<shadow color="#000000" size="5">True</shadow>