From 58dc96b12410640dd5cccb92b4788e8aecf497e8 Mon Sep 17 00:00:00 2001 From: Jonathan Corwin Date: Wed, 8 Sep 2010 22:55:24 +0100 Subject: [PATCH 1/2] Anchor footer from bottom, and prevent footer line wrapping --- openlp/core/lib/htmlbuilder.py | 20 ++++++++------------ openlp/core/lib/theme.py | 4 ++-- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/openlp/core/lib/htmlbuilder.py b/openlp/core/lib/htmlbuilder.py index acf00bdeb..2d18c7a68 100644 --- a/openlp/core/lib/htmlbuilder.py +++ b/openlp/core/lib/htmlbuilder.py @@ -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">' return lyrics -def build_footer_css(item): +def build_footer_css(item, height): """ Build the display of the item footer @@ -512,26 +512,22 @@ 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(), + bottom = height - int(item.footer.y()) - int(item.footer.height()) + lyrics_html = style % (item.footer.x(), bottom, item.footer.width(), item.footer.height(), theme.font_footer_name, - theme.font_footer_proportion, theme.font_footer_color, align) + theme.font_footer_proportion, theme.font_footer_color) return lyrics_html def build_alert_css(alertTab, width): diff --git a/openlp/core/lib/theme.py b/openlp/core/lib/theme.py index 50894cc47..ee3418dca 100644 --- a/openlp/core/lib/theme.py +++ b/openlp/core/lib/theme.py @@ -56,7 +56,7 @@ BLANK_THEME_XML = \ Normal False 0 - + Arial @@ -65,7 +65,7 @@ BLANK_THEME_XML = \ Normal False 0 - + True From dd2136774b231de26667c4bbd9fc7aa425fdde75 Mon Sep 17 00:00:00 2001 From: Jonathan Corwin Date: Thu, 9 Sep 2010 08:30:14 +0100 Subject: [PATCH 2/2] Remove height, so fix actually works --- openlp/core/lib/htmlbuilder.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openlp/core/lib/htmlbuilder.py b/openlp/core/lib/htmlbuilder.py index 2d18c7a68..7f4fc5082 100644 --- a/openlp/core/lib/htmlbuilder.py +++ b/openlp/core/lib/htmlbuilder.py @@ -514,7 +514,6 @@ def build_footer_css(item, height): left: %spx; bottom: %spx; width: %spx; - height: %spx; font-family: %s; font-size: %spt; color: %s; @@ -526,7 +525,7 @@ def build_footer_css(item, height): return u'' bottom = height - int(item.footer.y()) - int(item.footer.height()) lyrics_html = style % (item.footer.x(), bottom, - item.footer.width(), item.footer.height(), theme.font_footer_name, + item.footer.width(), theme.font_footer_name, theme.font_footer_proportion, theme.font_footer_color) return lyrics_html